Open RdeWilde opened 7 years ago
If you're using the Gateway directly, you're basically handling Map<String, dynamic>
, which isn't very helpful statically. However, if you're using the ORM (Repository<T>
), then where
should have the signature (bool predicate(T t)) -> Query
. If this is not the case today it should be, and since generic methods are now available, maybe this should use that in some way.
To summarize:
gateway.table('users')
.where((User user) => ...); // <- necessary
usersRepository
.where((user) => ...); // <- should be inferred
Second option looks awesome. I'll look into adding generics. If I come up with anything interesting, I'll post here
Is it possible to have strong typing in the query building?
For example for here, where existence of
user.age
would be checked at compile time:And with that I don't mean manually putting in something like this everytime:
And will the result be 'strong/static' typed?