drift
drift copied to clipboard
Make the tables and daos list receive only its supported types (Table/DatabaseAccessor)
I just made the list of tables receive classes that extends Table class and the daos list receive classes that extends DatabaseAccessor class.
Thanks for the contribution!
I'm not sure if this works though. We'd have to change usages from
@UseMoor(tables: [Users])
to
@UseMoor(tables: [Users()])
and convert the type to an actual instance. This is pretty breaking, especially since Table doesn't have a const constructor. I've left a note on a related Dart language issue asking for something like List<Type<Table>>.
Thanks for the contribution!
I'm not sure if this works though. We'd have to change usages from
@UseMoor(tables: [Users])to
@UseMoor(tables: [Users()])and convert the type to an actual instance. This is pretty breaking, especially since
Tabledoesn't have a const constructor. I've left a note on a related Dart language issue asking for something likeList<Type<Table>>.
I took some time trying to fix it until I saw you comment here. Thank you.
@pedromassango @simolus3 should this be closed so a surface level evaluation of long-outstanding PRs isn't an orange flag to new people evaluating this package? thanks
Good point - unfortunately the PR doesn't work as is and since Type isn't generic it can't be fixed either.