Live data from Hacker News

Prisma – ORM for Node.js and TypeScript

prisma.io

1–10 of 260 posts

Re: Prisma – ORM for Node.js and TypeScript

#5
post #2

I'm just about to start working on DB layer for our app with TypeScript. Any other alternatives to prisma you guys prefer and why?

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.

Re: Prisma – ORM for Node.js and TypeScript

#6
post #2

I'm just about to start working on DB layer for our app with TypeScript. Any other alternatives to prisma you guys prefer and why?

Hey, Nikolas from Prisma here.

There are quite a few other ORMs for working with DBs in TypeScript (none of them providing the same type-safety guarantees that Prisma does though [1]).

In fact, we laid them out on a docs page [2] in case you want to learn which tool might be appropriate for your use case.

[1] https://www.prisma.io/docs/concepts/more/comparisons/prisma-...

[2] https://www.prisma.io/docs/concepts/overview/should-you-use-...

Re: Prisma – ORM for Node.js and TypeScript

#8
post #5
post #2

I'm just about to start working on DB layer for our app with TypeScript. Any other alternatives to prisma you guys prefer and why?

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.

Yeah, 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.

Re: Prisma – ORM for Node.js and TypeScript

#9
post #2

I'm just about to start working on DB layer for our app with TypeScript. Any other alternatives to prisma you guys prefer and why?

Hey, Nikolas from Prisma here. There are quite a few other ORMs for working with DBs in TypeScript (none of them providing the same type-safety guarantees that Prisma does though [1]). In fact, we laid them out on a docs page [2] in case you want to learn which tool might be appropriate for your use case. [1] https://www.prisma.io/docs/concepts/more/comparisons/prisma-... [2] https://www.prisma.io/docs/concepts/overv…

Thanks, that's really useful.

Re: Prisma – ORM for Node.js and TypeScript

#10
post #2

I'm just about to start working on DB layer for our app with TypeScript. Any other alternatives to prisma you guys prefer and why?

(haven't tried Prisma)

TypeORM -> classic ORM, the "default" choice in node, but not very mature compared to what exists in Java or things like Django ORM. In my experience it's not an amazing lib, transaction management is a bit painful, I've seen a couple bugs happen.

Knex -> it works but not sure why you'd use that rather than TypeORM

MikroORM -> not a lot of experience, one of my colleagues really likes it, read the principles behind it and see if that talks to you as it's a bit opinionated

Slonik -> Never used it but probably what I'd set up on a new project. Like many people I think that query builders are BS and I'd rather use SQL: Slonik makes that very easy while giving you the usual getOne/getMany utilities

I'd like to try Prisma though, I've heard good things

Post reply on HN