Skip to content

Conversation

@damian-molinski
Copy link
Contributor

Description

This PR removes old DAOs and tables

Related Issue(s)

Part of #3528

Description of Changes

  • Removed old DAOs and tables + migrated existing logic into new DAOs. No logic changed

Please confirm the following checks

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream module

@damian-molinski damian-molinski self-assigned this Nov 19, 2025
@damian-molinski damian-molinski added the squad: face Frontend Catalyst Experience Team label Nov 19, 2025
@damian-molinski damian-molinski moved this from New to 👀 In review in Catalyst Nov 19, 2025
@github-actions
Copy link
Contributor

📚 Docs Preview

The docs for this PR can be previewed at the following URL:

https://docs.dev.projectcatalyst.io/voices/chore/remove_old_daos

///
/// Returns the number of deleted rows.
Future<int> deleteWhere({
List<DocumentType>? notInType,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
List<DocumentType>? notInType,
List<DocumentType>? typeNotIn,

Suggested one reads:
delete where type not in ...

Current one reads:
delete where not in type ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ended up with excludeTypes

Comment on lines 9 to 20
late DriftCatalystDatabase db;
late DocumentsV2LocalMetadataDao dao;

setUp(() async {
final connection = await buildTestConnection();
db = DriftCatalystDatabase(connection);
dao = db.driftDocumentsV2LocalMetadataDao;
});

tearDown(() async {
await db.close();
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be moved inside of the group(DriftDocumentsV2LocalMetadataDao, () {?

//ignore: one_member_abstracts
abstract interface class DocumentDataSource {
Future<DocumentData> get({required DocumentRef ref});
Future<DocumentData?> get({DocumentRef? ref});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If ref is null, how do you determine which document to return? If it straight throws an error - it's better to require the ref here and throw before this is even called.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, i wanted to make it too generic so i could override it in DocumentDataLocalSource but i'll split it into two methods

Comment on lines 22 to 23
DocumentRef? ref,
DocumentRef? refTo,
Copy link
Contributor

@dt-iohk dt-iohk Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit confusing if ref is next to refTo because refTo param translates to ref field from signed doc and ref param translates to id and ver. Clearest would be to have param names be the same as field names but that's not possible. How about renaming ref to selfRef and refTo to ref?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, renamed refTo to referencing. I'll deal with ref in separate PR

Base automatically changed from feat/campaign_total_ask to feat/database_optimization_3528 November 21, 2025 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

squad: face Frontend Catalyst Experience Team

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

3 participants