-
Notifications
You must be signed in to change notification settings - Fork 445
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
When using @UseRowClass, Drift expects every constructor parameter of the row class to match a table column.
This makes it difficult to use domain models that contain:
- Relationship objects (e.g. profile, creator)
- Computed or derived fields
- Runtime-only fields
Even when those fields are not meant to be stored in the table, Drift reports:
Unexpected parameter <field> which has no matching columnDescribe the solution you'd like
Allow @UseRowClass to explicitly ignore selected constructor fields.
Example API:
@UseRowClass(
User,
ignoreFields: {'profile', 'creator'},
)
class Users extends Table {}or
class User {
final String id;
@DriftIgnore
final Profile profile;
}
@UseRowClass(User)
class Users extends Table {}This would tell Drift that these fields exist on the row class but are not backed by columns.
Why this is useful
- Many apps use rich domain models, not flat row-only models
- Relationships are often loaded manually via joins => Can use
.copyWith()directly from the model.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request