News for hackers. Stuff that matters.
Re:Prisma 2.0 – Type-safe and auto-generated database client by davedx on Tuesday June 09, 2020 @11:10AM (#23467312)
Does it have migrations yet?

I'd like to give Prisma a try, but if there's no sane way to change my schema (part of my daily backend workflow) then it's less interesting, no matter how nice the API is. For now I'll stick with Sequelize.

Re:Prisma 2.0 – Type-safe and auto-generated database client by nikolasburk on Tuesday June 09, 2020 @11:17AM (#23467377)
Today's release unfortunately doesn't include our migration solution Prisma Migrate [1] yet. We totally understand that a lot of people want to get "database access" and "schema migrations" with the same tool/library, that's why we're focusing most of our engineering efforts on Prisma Migrate next and will hopefully be able to release that soon!

However, we do see a lot of folks using third-party migrations (like knex.js or indeed Sequelize) and then still get the benefits of Prisma Client [2] through introspection [3] for the time being. For non-critical applications we also already see lots of users who are trying out Migrate and help us improve it through constant feedback! I'd love to hear your thoughts on the current version so that we can make sure to consider your feedback and ideas for Migrate when building it out over the next few months.

[1] https://www.prisma.io/docs/reference/tools-and-interfaces/pr...

[2] https://www.prisma.io/blog/announcing-prisma-2-n0v98rzc8br1/...

[3] https://www.prisma.io/docs/reference/tools-and-interfaces/in...

Re:Prisma 2.0 – Type-safe and auto-generated database client by andrewingram on Tuesday June 09, 2020 @12:07PM (#23467844)
Is there a plan for a higher-level migration API rather than just generating + executing raw sql strings?
Re:Prisma 2.0 – Type-safe and auto-generated database client by albertoperdomo on Wednesday June 10, 2020 @08:08AM (#23476172)
I’m with the Product team at Prisma. Prisma Migrate (experimental) generates migrations from changes to the Prisma schema. These migrations use an internal DSL that ends up translating to SQL commands for relational DBs. Can you please elaborate a bit more on what you’d expect as a higher-level migration API?
Re:Prisma 2.0 – Type-safe and auto-generated database client by gabrielizaias on Tuesday June 09, 2020 @11:15AM (#23467349)
They have, but it's "experimental" at the moment: https://www.prisma.io/docs/reference/tools-and-interfaces/pr...
Re:Prisma 2.0 – Type-safe and auto-generated database client by dirkc on Tuesday June 09, 2020 @06:22PM (#23471621)
I'm very glad to see work being done on db bindings, but until migrations reach the level of django/active record, I won't be using postgres + node.js seriously (again).
Re:Prisma 2.0 – Type-safe and auto-generated database client by albertoperdomo on Wednesday June 10, 2020 @06:29AM (#23475595)
I'm with the product team at Prisma.

Prisma Migrate is different from ActiveRecord migrations (which are very familiar with) because the DB schema is state-based. The Prisma schema file acts as source of truth and the DB schema will be migrated to match it.

Can you elaborate on what you would perceive as reaching the level of Django/ActiveRecord? I'd be interesting in specific aspects/items.

Re:Prisma 2.0 – Type-safe and auto-generated database client by dirkc on Thursday June 11, 2020 @11:50AM (#23490088)
That sounds great! I'm not super familiar with ActiveRecord, but I use Django migrations regularly. For me the things that stand out are

1. a declarative model - ie. defining the db schema rather than the migrations

2. auto generated migrations with the ability to customize

3. integration with tools for deployment and testing

You probably have a much better idea of the landscape, but reach out to Andrew Godwin [1], he wrote south and then rewrote it to become django migrations.

[1] - https://www.aeracode.org/

Re:Prisma 2.0 – Type-safe and auto-generated database client by albertgao on Wednesday June 10, 2020 @12:42AM (#23473991)
no worries, it's their goal :)
Re:Prisma 2.0 – Type-safe and auto-generated database client by nsonha on Wednesday June 10, 2020 @01:04AM (#23474122)
Many people don't care for their schema language anyway so they won't miss writing migrations in it. Just do migration like normally with SQL.