Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing members on filtering reference columns #3465

Open
jackd opened this issue Feb 11, 2025 · 2 comments
Open

Missing members on filtering reference columns #3465

jackd opened this issue Feb 11, 2025 · 2 comments
Labels
area-manager Related to the manager, exposing an easier to use interface

Comments

@jackd
Copy link

jackd commented Feb 11, 2025

Columns with references have corresponding filters with fewer methods.

class User extends Table {
  late final id = integer().autoIncrement()();
  late final name = text()();
}

class Posts extends Table {
  late final id = integer().autoIncrement()();
  late final userId = integer()();
  late final userIdWithReference = integer().references(User, #id)();
}

@DriftDatabase(tables: [User, Posts])
class AppDatabase extends _$AppDatabase {
  void foo() {
    managers.posts.filter((p) => p.userId.equals(1)); // works fine
    
    managers.posts.filter((p) => p.userIdWithReference.equals(1));
    // The method 'equals' isn't defined for the type '$$UserTableFilterComposer'.
    // Try correcting the name to the name of an existing method, or defining a method named 'equals'.
  }
}

Expected behaviour: adding a reference shouldn't result in less functionality.

@simolus3 simolus3 added the area-manager Related to the manager, exposing an easier to use interface label Feb 12, 2025
@simolus3
Copy link
Owner

@dickermoshe I wonder if Composers for references should implement ColumnFilters for the local column?

@dickermoshe
Copy link
Collaborator

dickermoshe commented Feb 13, 2025

Smart idea. I'll keep that in mind for V3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-manager Related to the manager, exposing an easier to use interface
Projects
None yet
Development

No branches or pull requests

3 participants