4 ms·
I suggest to not add a layer. Stay close of the SQL request, you can simply have a function that will fulfill an access pattern. No need for ORM.
by eydwales 5y ago
I suggest to not add a layer.
Stay close of the SQL request, you can simply have a function that will fulfill an access pattern. No need for ORM.
- ponyous 5y agoYeah, I have no problem with minimum ORM (prepared statements type of thing) - That's why I am asking the question, Prisma seems a bit too much. Usually I just use simple ORM helpers (get by primary key for example) and anything complex is raw sql. What I am looking for is ideally something that helps with type saftey and seeds/migrations/schema creation.
- topicseed 5y agoTry Knex!
- domlebo70 5y agohttps://github.com/gajus/slonik https://github.com/gajus/slonik
- heisenbit 5y agoI'm wondering at the moment whether Knex (solid query builder and migration) and Objection.js would not do this trick. That combo seems to give me json validation which is nice and seemingly both a way to handle entities and graphs in an efficient way.
- gmac 5y agohttps://jawj.github.io/zapatos/ https://jawj.github.io/zapatos/ (no built-in migration support, though)
- tekkk 5y agoI have been using Flyway with Node.js. Works all right and you write everything (migrations, schema, seeds) in SQL. It does make working with SQL quite straightforward and non-magical. The thing is of course that with very complex queries you'll end up making quite intricate string building stuff which may not be very pretty. I myself am curious to find out if Prisma can make that part go away.