|
|
|
|
|
by dathinab
639 days ago
|
|
> Writing dynamic/conditional queries just sucks and there isn't any good solution. SQLx is just providing some "core" foundations, which means yes there is no good query builder or anything like that. So if you want to compare SQLx with e.g. Diesel it's a bit comparing apple to apple trees, instead comparing sqlx+sea-query (or sqlx+sea-orm) would be a better comparison (through sqa-orm again isn't a fully even comparison as it goes ins some points further then what diesel provides). Idk. about now but last time I touched diesel (quire a while ago) I found their query building catastrophically bad the moment the query isn't build all in one place, productivity also wasn't good with it. There was also pretty bad security issue they handled IMHO catastrophically convincing me to stay away from it. Through I guess a lot of things probably got much better since then. |
|
I tried sea-orm, but I find its ORM API way too limited (it can't even do multiple joins). For anything beyond simple queries, you end up needing to use its query builder (sea-query) which is blind to your db schema so you need to manually hand-validate all your queries. It's basically no better than pushing string queries + manually validating the output with serde.
> I found their query building catastrophically bad the moment the query isn't build all in one place
If you're talking about its crazy return types, there's the auto_type macro that lets you generate return types for functions automatically.
> There was also pretty bad security issue
That sounds concerning, can you link it here?