Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I agree with that sentiment. Concatenating strings is miserable and error-prone, especially for highly dynamic queries.

But there's still another step between a full-blown ORM and a query builder, where you still define the models and the relations between them, but fall back to a plain query builder for constructing queries. That way, you're not dealing with plain arrays, etc., but you're still essentially writing SQL. Like Objection.js[0], which is built on Knex.

[0] https://vincit.github.io/objection.js/



What's wrong with working with plain arrays? Genuine question, they seem to work fine for me so far.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: