6 ms·
You should check objection.js[1] as I think it would get you what you describe and probably more. It is a relational query builder built on top of knex, which i
by goliatone 6y ago
You should check objection.js[1] as I think it would get you what you describe and probably more. It is a relational query builder built on top of knex, which is a query builder.
[1] https://vincit.github.io/objection.js/ https://vincit.github.io/objection.js/
- renke1 6y agoThanks, I'll check it out. But on first glance it doesn't seem to let me write actual SQL queries. Also, it doesn't seem to be typesafe, or is it?
- mceachen 6y agoI wrote the original typescript bindings for objection. One of the library authors is a contributor to knex.js, which objection uses for query building. Both are quite nice. With either library, you aren't writing naked SQL, but something like `query.where("updated_at", ">", Date.now())`. Tsc comes into play when you send typed objects into your .where, .insert, ... methods and what you get back from the query. It's close enough to SQL that you don't lose expressiveness, you're not behind walls of magick due to orm, and you don't have to worry about Bobby Droptables.