If you hesitate to migrate to Prisma2

* On Prisma v2 the Prisma server is optional:

This is due to a fundamental architecture change: the query and migration engines that previously ran inside the Prisma server can now run as plain binaries alongside your application on the same host.

* Performance improve made database seeding faster on 95% (based on my own experience😊) :

Test was made on the same machine and with the same dataset and db structure in postgresql 10.5:

* More flexible database migrations:

Prisma v2 Migrate is a powerful database schema migration tool. It uses a declarative data modeling syntax to describe database schema. It also stores the entire migration history and easily lets revert and replay migrations and also allows to run before-and-after hooks to execute scripts while migrating so now possible to populate the database with required values during a migration.

* One more powerful improvement — In Prisma v2 was added transactions:

Prisma Client provides a data access API to read and write data from a database. For relational databases, Prisma Client’s API abstracts over SQL where transactions are a common feature. Unfortunately Prisma Client doesn’t allow for the same flexibility a SQL-level transaction provides, but it covers most majority cases as creating, updating or deleting data across multiple tables in a single Prisma Client query.

So, if you gonna to migrate from Prisma1 to Prisma2 — just do it.

Possible that you’ll have some pain after migration but the game is worth the candle. As result — you will get fast and powerful ORM for your database.
And if for some reason you still don’t use ORM at all — you have a great chance to start use Prisma2. As benefit you will get:
* Easy way for connecting to the DB;
* You need only to create a proper schema and Prisma will automatically create all tables and relations;
* No need to thing about difficult SQL queries, because Prisma can get the data based on relations specified in the schema;
* And if you need input/output types — PrismaClient will provide them for you;



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store