Live data from Hacker News

Prisma – Database tools for modern application development

prisma.io

61–70 of 88 posts

Re: Prisma – Database tools for modern application development

#61
post #19

Back when prisma was emerging out of graphcool, every google documentation search sent me to graphcool, every graphcool page was full of broken links, and the shiny new prisma docs were unusable (including unviewable on my iPad that I use for researching tech I might use while sitting on the couch). It painted such a clear picture of a company that absolutely does not get the importance of API documentation to the su…

Docs are pretty horrible to read on my phone, chrome on Android. Panels are getting put side-by-side and the text inside is smashed to like 8 characters across. Too much whitespace. It's like ok ok you've gone and designed the fuck out of your page, but why'd ya have to do it to the docs? Unreadable. Since it sounds like the devs are watching this thread I figured I'd mention it.

(I work at Prisma)

It's true that we haven't focussed on a mobile experience for the docs so far (assuming a primary use case for the docs is when being used on your computer as you're using Prisma). However, we see that many people like to browse docs on their phones to learn about the tool, so we are now making it a priority to make our docs responsive! Thanks for the feedback.

Re: Prisma – Database tools for modern application development

#62

Earlier quoted context omitted.

That's a good question. As long as you have additive changes, Prisma can do the change automatically for you. As soon as it's a change where anything will be dropped (field, relationship etc), Prisma will prompt you and ask if you want to perform that breaking change. The only command you need to know for data model changes is `prisma deploy`. Disclaimer: I work at Prisma.

As someone who has been using Prisma religiously for the past year, I would like to express that this is the largest pain point of working with the platform. Not having the ability to custom define these transformations is brutal.

That is great to hear! Because we're working on exactly fixing that! What is the concrete limitation you're hitting with that?

Re: Prisma – Database tools for modern application development

#63

How is this different from any other ORM library?

I work at Prisma and this is one of the questions we're currently hearing the most (we'll actually publish a blog post about this exact question soon).

Generally, think of Prisma as a suite of database tools that simplify workflows in three different areas:

● Database access / ORM (lightweight, auto-generated and type-safe database client for various languages)

● Declarative data modelling and migrations

● Data management with modern admin UI

I think it also differs from traditional ORMs in that it supports multiple databases. We see a trend that many modern apps are built on top of a variety of databases, it might use Posgtres, Elastic, Mongo and Neo4j all at the same time for different purposes. We are embracing this and with the Prisma client it will be possible in the future to access all these data sources in a single, coherent and type-safe API.

Feel free to check out our roadmap to get an idea of what we're working on: https://github.com/prisma/prisma/blob/master/ROADMAP.md

Re: Prisma – Database tools for modern application development

#64

Hm... is this is like JOOQ[1] for non-Java languages? Or maybe more like a typed version of massivejs[2]? [1] https://www.jooq.org/ [2] https://massivejs.org/

No Prisma is not like JOOQ. We are happily using JOOQ internally at Prisma so i happen to know. The main differences in my opinion are: - JOOQ is a SQL Query Builder which is typesafe in regards to the fact that you cannot make SQL syntax errors in your query. However you can still write queries that are e.g. using a table that does not exist. In contrast the Prisma Client gets generated for all your tables and columns and this error is impossible. You also don't need to do any mapping from SQL result sets to your application models. - JOOQ is about SQL. Prisma is not only about SQL but also any other kind of database. Prismas architecture is comprised of a database agnostic core and database specific connectors. Therefore it can connect to any database for which a connector exists. Right now we have connectors for Postgres, MySQL and MongoDB. More are in the works and in the future people will be able to implement their own connectors :-) - Prisma has a migration system but JOOQ does not have one.

Re: Prisma – Database tools for modern application development

#65

To be fair. That Golang implementation looks overly verbose. I mean compare the Typescript and Golang implementation. The Golang one isn't even readable. I'd personally use something else instead.

That is a fair point. The current Golang implementation is the first one we did. Right now we are working on a new version of the Prisma Client. And the Golang version will get a lot of love over the coming weeks.

Re: Prisma – Database tools for modern application development

#66

So If I understand it right, this is an ORM (with some graphql like properties) with the addition of data model code generation?

it's more than just a traditional ORM layer. They run a server (prisma) between the client and the database.

Re: Prisma – Database tools for modern application development

#67

Prisma looks good and I hope it succeeds. Another interesting and unique approach I'd love to see get more attention is Mammoth[0]. Instead of abstracting the database away, you define columns using its raw primitives (in this case, Postgres) and in return get a type-safe client, along with auto-generated migrations. I imagine this approach allows you to leverage the features of the database much more easily. And Pos…

Right, instead of abstracting away the database I think it makes sense to invest in making it attractive to use. Putting an abstraction layer (like ORM) on top of it basically hides it's amazing features. PS. maintainer of mammoth here. Thanks for the mention.

I totally agree with this and this is actually very relevant for us at Prisma as we're supporting various kinds of databases. Our goal isn't to have one universal data access abstraction, but instead we want to ensure developers still get all the benefits of the databases they're using underneath (as all of them have different strengths and are great for different use cases)! We're currently working on an improved version of our data modelling language that will make it possible to model DB-specific properties (indices, special DB types, ...) into your Prisma datamodel, you can find the RFC for it here: https://github.com/prisma/rfcs

PS. We've looked into mammoth a lot for inspiration and really liked it, great work!

Re: Prisma – Database tools for modern application development

#68
post #3

It's been interesting watching Prisma, formerly Graphcool, transition from backend-as-a-service to open source backend to client ORM library. They also use bleeding edge patterns, so I always know where to go for examples as stuff gets adopted mainstream :) Keep up the good work Prisma team! Question specific to this autogenerated client: does that mean I have to bump client version numbers every time my backend sche…

(I work at Prisma)

Thanks a lot for the positive feedback, we appreciate it a lot! As to your question, I assume with "backend schema" you're talking about the Prisma datamodel? Whenever you change the datamodel, you're also re-generating your Prisma client. So, it can definitely make sense to version your Prisma client as your datamodel changes. Does this clear it up?

The main purpose of the code generation really is to have proper typings for all database operations based on the datamodel. For example, if you're adding a new model type to the datamodel, Prisma doesn't only generate according models in your programming language, it also generates types that facilitate filtering, pagination, ordering and any other operations of your database.

Re: Prisma – Database tools for modern application development

#69

To be fair. That Golang implementation looks overly verbose. I mean compare the Typescript and Golang implementation. The Golang one isn't even readable. I'd personally use something else instead.

Totally agree! I'm actually working on improving the Go API right now. We'll have a new API in the coming weeks that should look a lot more idiomatic :-)

Re: Prisma – Database tools for modern application development

#70
post #58

We have been using Prisma for our newest project, and have really enjoyed it! The development experience is unparalleled in the Node.js world, it lets us move so quickly. There are some rough edges, but the team is very responsive and they have fixed most of my minor gripes over the past months. Overall I am happy we chose it and I would choose it again.

Thanks a lot for the feedback Max, we really appreciate it! We're currently working on many improvements (e.g. a more powerful data modelling syntax, a sophisticated migration system, opening up the database connector and client generator APIs, ...) for Prisma that you can check out in our RFCs: https://github.com/prisma/rfcs
Post reply on HN