should i use drizzle or prisma?

share

Summary of results

GPT-4o
Warning: quote links might not work while streaming
1.

Love Prisma. Been using this for a few side projects as well as on my company projects, and it worked out really well for us.

2.

Prisma does the heavy lifting on our project:

https://www.prisma.io

I don't have experience with Knex so I, unfortunately, don't have an answer to your question.

3.

Prisma is also an interesting case as it used to be queried via GraphQL but now they use their own query language. It’s still quite useful to build GraphQL based APIs though.

4.

I substantially regret using Prisma in production for this and very many other reasons.

At least the underlying data is well modeled, just need to rip out the JS library and replace it… but with what?

5.

Prisma is one of the runtime currently supported [1]. Metatype enables you to compose multiple runtimes together. Let's say you have model/struct product (id, name, similarProducts), the two first attributes may be stored in Prisma (like you would do it normally), the third one can come from another runtime such as an HTTP api and the engine will take care of resolving the data together. You can also add an authorization policy on any of the fields.

[^1] https://metatype.dev/docs/reference/runtimes

6.

This is extremely disappointing news coming from somebody who architectured a project based on the fact that Prisma is the perfect multi-language schema DSL.

The only edge for Prisma is now lost - I might as well just use Drizzle.

7.

Can DRIZZLE help to achieve higher resolution? Though with hundreds of photos this will imply a lot of work:

https://en.wikipedia.org/wiki/Drizzle_(image_processing)

8.

Prisma is a nice product but I wouldn’t use it in production yet. It is prone to race conditions as it does not use native upserts, opting instead for Rails-style check-if-exists-insert-if-doesnt.

9.

Haven’t used prisma but I think their query builder type checks (not just the results) which make composing and writing them quite a bit more convenient than the example shows.

11.

Meanwhile, some companies are building products with Prisma and are enjoying their choice. I love Prisma with Postgresql and Typescript, it's a very productive tool.

My first opinion wasn't very far from yours, but then I adopted it. It has served me well after a year and multiple projects.

12.

When I used prisma a few years ago I was not impressed and it couldn't do a lot of what I needed so I had to dump into raw sql queries anyway. It was easier for me to use knex and get the types mostly right.

13.

Do you like Prisma?

I think it's cool but it sucks that their prisma schema doesn't support constraints and more complex things. It is very basic and for any real world use migrations need to be used.

And I've had issues using it with SQLite. It doesn't support case insensitive filtering when using SQLite (I know, neither does SQLite). But as a result, i have to build a custom query which is pretty much what i wanted to avoid by using Prisma.

15.

Prisma is pretty good, but I'm hoping they pay attention to migrations soon and reverse the decision not to use transactions in migrations.

16.

Completely off-topic, but do you like prisma, and how are you using it (scale, complexity, solo vs team, etc).

I toyed around with it a while back, and it looked potentially awesome, but different enough that I was worried about using it on a work project in case it failed in some use case.

Im so sick of the SQL ORM situation in Typescript, but Prisma might have an answer.

17.

Well the question you saw coming (hopefully) - how does it compare to Prisma use cases?

One thing I really like about Prisma is only updating my schema and having migrations generated as the "diff".

18.

Prisma maybe? https://www.prisma.io/

It's mostly part of a JS/TS ORM, but it uses a declarative schema language, and there are libraries in other languages to parse and process it. E.g. https://prisma-client-py.readthedocs.io/en/stable/

19.

As someone who uses both prisma and knex (so something like kysely):

Prisma is very very nice, it has maybe the best DX out there. My issue with it is performance. It is much slower than query builders or raw sql. It's also a huge black box, although I haven't had any issues, you're dealing with a complex beast.

Knex (and other query builders) is nicer than raw sql, has good performance, and it's fairly transparent (it's not a 800 pound gorilla like Prisma)

21.

Prisma uses rust for two main reasons from what I understand. 1) to keep the engine portable and maximize code reuse, to make projects like this Python adapter possible for example 2) under the hood Primsa does not use joins. It does a waterfall of queries (but not n+1), then stitches the data together in memory, which happens in the rust engine for performance reasons

22.

Prisma is a nice DB client library but does't do any of the things I'm interested in - reactive queries on the client, recursive graph traversal, raising level of abstraction for the organization. Schematizing the DB & a type-safe DB client is nice, but I'm more interested in stuff one or two levels of abstraction up. Like, after the data comes into memory Prisma is done and out of the picture. But getting the data into memory is the easy part IMO. Traversing it, adding permissions and business logic, managing & composing mutations, dealing with caching and reactivity.. that's the good stuff, and I'm not sure what if any Prisma offers there.

23.

I'm using Prisma ORM over Drizzle (didn't exist when I started).

When I need to add new data to a table I have, I just put the "new_column Type" in my prisma.schema for table X. and run "npx prisma migrate dev." Then everywhere else in my code, I already have the updated type for my object X.new_column and can access it with the guardrails of not betraying what type it is.

I'd rather do that than ALTER TABLE to create and update my read queries, while making sure I don't make a mistake in the raw SQL.

24.

A lot has changed in the past years of Prisma, it's a really great tool, to be honest, "raw sql" escape hatches to do anything raw when you need it, if you haven't tried it in years, I'd recommend you to try again since if you tried it years ago, it was a very different maturity level.

26.

I didn't mind prisma for managing the schema etc but also seen your linked github issue. I found other people recommend combining Prisma with Kysley. I have only used this in toy projects so take this with a grain of salt.

https://kysely.dev/

https://github.com/valtyr/prisma-kysely

27.

Another "almost" like SQL library that I've heard floating around:

https://github.com/drizzle-team/drizzle-orm

I think I've reached the limits of Prisma and embarrassingly I'm thinking about ripping it out. The benefits of not having to constantly reference your DB schema and having IDE guidance is not matching up to the idiosyncrasy and incomplete DB support of Prisma.

28.

How does this differ from Prisma? https://www.prisma.io/.

I do like the quick bootstrapping Remult offers via "JSON db" if one hasn't set up a DB yet. And entity classes defined as a .ts file is nice, as opposed to Prisma's DSL (e.g. schema.prisma file).

30.

Not sure exactly what you mean here. Prisma is an ORM for developers working with databases in TypeScript. EnrichMCP is more like an ORM for AI agents. It’s not focused on replacing Prisma in your backend stack, but it serves a similar role for agents that need to understand and use your data model.

It's also Python.

31.

Prisma is an offshoot of graphql.cool, which was a "graphql API as a service". It seems to me that was a potentially good and viable business. However they stopped graphql cool and released Prisma, where there's no business model (who's gonna pay for an ORM?). I'm still left wondering why they did that?

32.

> Prisma, a next-generation ORM for TypeScript which means that the core query building and connection handling has been battle tested, getting around a potential concern with adopting a new ORM.

Can I suggest you put this at the top of your README.md file, as I had never heard of Prisma before and it would have helped.

> Prisma Python

Is your program called Prisma Python or Prisma Client Python? You seem to be inconsistent with naming.

33.

I went down the Prisma path investigating JavaScript ORMs, and... I have opinions. :)

I feel that what we have would be useful within a Prisma context, but given their complexity and how Prisma works, it's likely not very practical with their "engine".

34.

It's a solo project, CRUD stuff, but having used pretty much all JavaScript/TypeScript ORMs in existence, I can say that Prisma is way ahead of the competition. I would personally recommend it. A traditionally cumbersome and annoying thing about trying a new ORM is that you basically have to re-learn a pseudolanguage for building SQL queries but that hasn't been an issue this time, thanks to ChatGPT. So overall, happy with Prisma and plan to keep using it.

35.

Our Prisma schema resides in our "backend" (Prisma essentially governs our master API). So I'm not sure why you're concerned that the front-end might control the schema.

The nicest thing about Prisma is that it is a declarative single-source-of-truth for our data models. Everything resides in one schema, all changes to database models and all migrations run through Prisma, and, best of all, strong types are inherently built in.

The team is also building useful middleware like field-level encryption; all of this together makes Prisma a very complete package.

Of course, there is a price for this convenience — we sacrifice some higher-level DB-side features. But Prisma is such a competent tool that we don't miss them much.

36.

> There’s no one go-to

I thought Prisma.js was the most popular by far? It's the one I've always seen used in docs and examples.

37.

I've been dabbling with Prisma after almost a decade of staying away from ORMs such as EJB3 / Hibernate / iBatis.

With Prisma I like the ability to generate migrations and the DB schema from a single schema definition file. I also like the autogenerated simple crud use cases.

It did not take long to have to go raw. A simple case of selecting the top most occurring unique columns from a table with a join to limit by user id is brutally trivial oneliner in SQL that just rolls off the keyboard. I took a good try to do the same with Prisma and I believe it can be done, but the complexity of what the DSL will look like is laughable.

So I still have the same opinion I've had for these past years, ORMs are okay for simple crud stuff but the moment you need something slightly beyond that bailing for the raw sql is the best thing that you can possibly do for the maintenance team that comes after you have changed projects.

38.

I really do appreciate Prisma's developer experience though. Recently I've been testing out Prisma for migrations and Kysely as the actual ORM.

Prisma is generating the Kysely type definitions automatically so it is still pretty hands off without the production overhead of prisma server/client.

39.

I use Prisma typescript daily and love it. It's fast to write complex queries and readable joins. The type hints are well documented and custom generated for your models and relationships.

It would be great if Prisma could support yet more languages! It's a great product.

That said, I would not have two backends sharing the same database, even if one is the master that runs migrations. A component should only have one reason to change.

41.

These are more akin to Dapper which is a thin layer on top of SQL. Currently I use Prisma for JS, it's a bit better, but if you haven't used EF then you probably don't know what you're missing.

42.

I've tried both Chroma and Qdrant. I don't think Chroma lacks that much. Definitely newer, but is also a great product. I think cloud support coming Q3 2023

44.

I've been using Mistral Medium 3 last couple of days, and I'm honestly surprised at how good it is. Highly recommend giving it a try if you haven't, especially if you are trying to reduce costs. I've basically switched from Claude to Mistral and honestly prefer it even if costs were equal.

48.

Honestly, I hated Prisma for a while. I've tried to actively rip it out of multiple projects. But, typed queries + views being supported have rally started to change my mind. Prisma is great for basic CRUD operations, and those two features give me a really solid, type safe escape hatch for most of my complaints.

Dropping the rust client will solve another big complaint. I definitely feel the issues languishing problem. I've submitted a few confirmed reproducible bugs that have hung out for a couple years. Still, I'm happier with their recent direction than I would have expected.

49.

Seems pretty different. Prisma is an ORM basically, while this generates HTTP REST endpoints for you.

51.

I think I prefer the results from the other approaches listed in the examples, e.g. material blending: https://orikmcfly.artstation.com/projects/9zRna

52.

Dall.e is much better at understanding what you want. And sometimes stable diffusion feels a bit overfitted on some prompt (especially with cars).

But Dall.e is often behind in terms of image quality. They are nice looking from far, but a bit more blurry or weird than stable diffusion if you look closely.

However you can use boths together. These days I tend to use stable diffusion first, but when a prompt is not going well I copy paste it in dall.e and get what I meant much easily. And then I import the dall.e generated image in stable diffusion to work it a bit more and get something a bit better looking.

53.

Please remedy my ignorance if I might be wrong, but I thought Prisma was an ORM, not a true backend.

54.

Thanks for sharing this. I haven't tried tRPC yet, but I do use Prisma. I am slightly curious/puzzled why I would need both in the same project. Doesn't Prisma get you most of the way there? Or, is this for creating a CRUD REST API that talks to the DB via Prisma, and to the Client via REST/tRPC? Seems heavy to me.

55.

Prisma is pretty good, but the migrations system doesn't really compare. If your answer to many (any?) migrations is "blow away the existing database", that's not gonna work for me. Another thing that's not gonna work for me is generating each migration by hand with SQL specific to the dialect that youre using in development, now that I'm spoiled with Django's auto-migrations. I've had good success with Prisma by using Django to simply manage the schema and using `prisma pull db` (though Prisma unfortunately errors if you are using the default type for primary keys, AutoBigInteger because it can't handle BigNumber). Prisma is basically the ORM I had in mind when I said "there has been work in this space", FYI.

I have only used NextAuth a tiny bit, but it wasn't clear to me how to, for example, extend the user model to add fields to users. I would appreciate it if you have any resources you could point me to for an example or explanation on how to achieve that. I also did not find documentation about how to add my own authentication adapter (or plugin or whatever language they use).

57.

Tossing this one in here as it's a combination of Isoveska & PragmataPro: https://github.com/shytikov/pragmasevka

Been using it for a bit and I've really fallen in love with it.

58.

How does PragmataPro vs Iosevka compare?

I use Iosevka, but am curious about PragmataPro

59.

I use Prisma and it’s far from perfect but what I love about it is you can introspect a legacy database and generate a Prisma schema, and use the database as the source of truth. You’re not tied to a 1:1 relationship between classes and tables, and the correctness of the types do not depend on tediously annotating code correctly. Excited to see more languages supported!

60.

I've had better luck with Stable Diffusion using impressionist/surrealist/etc. styles because you don't really expect the results to be "right" in a literal sense.

63.

How do these techniques handle transparent, translucent, mesh/gauge/hair like objects that interact with background.

Splashing water or Orange juice, spraying snow from skis, rain and snowfall, foliage, fences and meshes, veils etc.

64.

Unless you like shimmer inks, which will clog your nice Metropolitan or Safari. A quill pen works just fine there, if you like taking the time to DIY. More people choose glass dip pens instead.

But me, yes I'll stick to my TWSBI Eco, Pilot Custom Urushi, and Lamy 2000, with a nice Blue-Black instead.

65.

I am in a startup that's using Prisma and it we really wish we had not:

- The query objects can become hard to read with anything more or less complex.

- If you need an unsupported Postgres extension you are out of luck.

- One large file in a schema, impossible to shard.

- We have many apps in a monorepo and they cannot have separate prisma connections cause the schema gets baked into "@prisma/client"

Basically the only thing useful about it are the TS types which is something SQL-builder libraries solve better. Long story short, use Kysely, Prisma provides no value that I see.

66.

As someone who teaches both oil painting and digital painting, I find this project fascinating. They have certainly identified two of the key difference between digital and real paint:

- RYB mixing (e.g. yellow painting plus blue paint = green). I tested it on a mix of alizarin crimson plus hansa yellow to produce a cold orange (e.g. blood orange).

- Relative behavior of specific pigments. For example, a Prussian blue is almost black when applied thickly, but very chromatic when applied as thinly over white. A cerulean blue is pretty much the same in those two states. I tested this on a Prussian and the app performed well.

The app seems to make the assumption that the artist will always want the paint to mix. In a glaze, a thin transparent layer of paint is applied over dry paint. Effectively the result is a filter (the result will always be darker). To a degree, this can be faked using paint applied in a layer the blend mode of which has been set to multiply. It might be nice to add a drying brush to the tool set which selectively dries the paint to prevent mixing. Maybe also a mode switch to selectively different modes of physical application such as glazing, scumbling and dry brushing. While we are at it, why not add a Tonk mode using which thick paint can be lifted off the surface without smudging.

When I paint digitally, I mix the incredible nuance of real paint... even its smell. When I paint with oils I miss the incredible flexibility of the digital process (blend modes, compositing, even the humble undo). Never the twain...


Terms & Privacy Policy | This site is not affiliated with or sponsored by Hacker News or Y Combinator
Built by @jnnnthnn