3 ms·
I'm currently observing the same with a client, also using Knex with Typescript. They're trying to work with the Knex-provided types, and built a (currently sti
by sally_glance 4y ago
I'm currently observing the same with a client, also using Knex with Typescript. They're trying to work with the Knex-provided types, and built a (currently still small) set of functions for shared logic like wrapping into a transaction. Those require a non-trivial amount of type-juggling and I'm not sure yet whether I like it. I've seen both plain SQL and ORMs in larger code bases, choosing between those and the "query builder with some custom abstractions" is hard.
Compared to plain SQL, the obvious advantage is that you don't have to work with string replacements, but a bit of readability/maintainability is lost because of emerging complexity. Compared to an ORM there is much less working around it's quirks, but also the danger of re-inventing a good part of it.
Btw they also wrote up a sizeable number of record types, Kanel looks interesting for auto-generating those - thanks!
- gmac 4y agoCheck out Zapatos too: https://jawj.github.io/zapatos/ https://jawj.github.io/zapatos/
- sally_glance 4y agoThanks, we will!