10 ms·
Query builders (as I call these type of tools) are great, especially when they allow typesafety over the SQL barrier. jOOQ[1] (on JVM) does this with code gener
by cies 6y ago
Query builders (as I call these type of tools) are great, especially when they allow typesafety over the SQL barrier. jOOQ[1] (on JVM) does this with code generation: migrate your db, re-generate the project specific jOOQ lib and all incompatible queries are not showing up red-underlined in your IDE.
I liked this as well in ORMs: the type safety them CAN provide.
Query builders VS ORMs, both have their advantages. Doing a Users.byId(123) is easier to read'n'write than doing so with a query builder. Its the complex queries where ORMs suck, string-SQL gives no type safety and query builders shine (given they provide type safety).
1: https://www.jooq.org/doc/3.14/manual-single-page/#jooq-in-7-steps-step5 https://www.jooq.org/doc/3.14/manual-single-page/#jooq-in-7-...