6 ms·
It was more of an ergonomics choice. To me it seems like it's more readable to write `await users.filter(user => user.id.eq(42).fetch(connector)` instead of `aw
by tilyupo 2y ago
It was more of an ergonomics choice. To me it seems like it's more readable to write `await users.filter(user => user.id.eq(42).fetch(connector)` instead of `await connector.fetch(users.filter(user => user.id.eq(42))`.
But I might be wrong, your idea makes more sense from logical perspective.
- deleted 2y ago[deleted]
- jgoyvaerts 2y agoWhat about moving the connector to the table declaration, similar to dbcontext in .net? Something like Q.table(definition, connector), which would then allow you to just write users.filter(user => user.id.eq(42).fetch()
- williamdclt 2y agoI’m not sure I can say which is _objectively_ better, but I was also surprised, connector.fetch would be more consistent with common JS practices