What ORM would you recommend for connecting a simple Express.js app to Postgresql?

Hey, guys. I've got an express.js app that is not sophisticated at all. I'm just testing out some backend concepts that I'm interested in, but this is the precursor for the backend of a react app that is similar to an online shop. My question is in the title. I'm curious to hear your recommendations, and thanks in advance :)
6 Replies
Jochem
Jochem12mo ago
if it's simple, probably just use a db connector and write your own queries, an ORM would be needless overhead
Mastle (AT)
Mastle (AT)12mo ago
I'm being told the opposite somewhere else It's starting to feel like it's a preferential thing I'm more comfortable with code rather than raw SQL, so I think ORM is more suitable for me
e of pi
e of pi12mo ago
Maybe something like kysely? It’s a “query builder” rather than a full ORM. Define your database schema as a typescript interface, then get “typesafe” queries that are still close to SQL conceptually.
Cahnis
Cahnis12mo ago
We use knex.js at work as query builder, if I had to use an ORM I'd choose prisma any day of the week
ErickO
ErickO12mo ago
I agree, if it's simple why use a whole ORM then again I think ORMs suck 😎 raw SQL is code, if you're learning I'd recommend not using an ORM because, beyond the fact that I dislike them, they hide away the entire implementation of your SQL so you're learning absolutely nothing and SQL is a valuable skill so learning it properly without any ORMs will put you above the average dev these days but if you don't care about any of that I agree kysely and knex are fine, they're query builders
Mastle (AT)
Mastle (AT)12mo ago
I appreciate all of your asnwers. After considering my situation, the structure of my app, and what I'm planning to do in the future, I have come to the conclusion that Prisma is the answer.