Can I still access my database directly (e.g. using raw SQL)?

Yes, Prisma Client provides a method called .raw which you can use to send raw SQL strings to the database.

Note that Prisma currently doesn't support full transactions. If your application needs transactions, you can use Prisma Client alongside other lightweight query builder such as knex.js to perform one-off queries as transaction.

Is Prisma Client an ORM?

ORMs are typically object-oriented mapping layers that map classes to tables. A record is represented as an object that not only carries data but also implements various behaviors for storage, retrieval, serialization and deserialization of its own data, sometimes it also implements business/domain logic. Prisma Client acts more like a query builder returning plain JavaScript objects with a focus on structural typing rather than rich object behavior.

Learn more on the Is Prisma an ORM? page in the docs.

Will Prisma Client support more databases (and other data sources) in the future?

Yes. Prisma Client is based on Prisma's query engine that can connect to any data source that provides a proper connector implementation. There will be built-in connectors such as the current ones for PostgreSQL, MySQL and SQLite.

However, it's also possible to build your own connectors, more documentation on that topic will follow soon.

How can I see the generated queries that Prisma Client sends to my database?

You can view generated SQL queries by providing the log option to the PrismaClient constructor like so:

const prisma = new PrismaClient({
log: ['query'],
})

Learn more on the Debugging page in the docs.

How do schema migrations work with Prisma Client?

Prisma Client is not opinionated on how exactly you migrate your database schema (e.g. create new tables, alter columns, ...). You can keep your existing migration system and re-introspect your database schema after each schema migration. You can also use Prisma Migrate to run your migrations based on Prisma's declarative data model definition.

Does Prisma Client support GraphQL schema delegation and GraphQL binding?

GraphQL schema delegation connects two GraphQL schemas by passing the info object from a resolver of the first GraphQL schema to a resolver of the second GraphQL schema. Schema delegation also is the foundation for GraphQL binding.

Prisma 1 officially supports both schema delegation and GraphQL binding as it exposes a GraphQL CRUD API through the Prisma server. This API can be used to as the foundation for an application-layer GraphQL API created with GraphQL binding.

With Prisma 2.0, Prisma's query engine doesn't expose a spec-compliant GraphQL endpoint any more, so usage of schema delegation and GraphQL binding with Prisma 2.0 is not supported. To build GraphQL servers with Prisma 2.0, be sure to check out GraphQL Nexus. GraphQL Nexus provides a code-first and type-safe way to build GraphQL servers in a scalable way.

Learn more about how Prisma can be used to build GraphQL servers on the GraphQL page in the docs.

Am I locked-in when using Prisma Migrate? Is it easy to migrate off it?

There's no lock-in when using Prisma Migrate. To stop using Prisma for your migrations, you need to:

  • delete your Prisma schema file
  • the migrations directory on your file system
  • drop the _Migrations table in your database/schema

How do I see details about how Prisma migrates my database schema?

Each migration is represented via its own directory on your file system inside a directory called migrations. The name of each directory contains a timestamp so that the order of all migrations in the project history can be maintained.

Each of these migration directories contains detailed information about the respective migration, for example which steps are executed (and in what order) as well as a human-friendly Markdown file that summarizes the most important information about the migration, such as the source and the target data model definition of the migration. This information can also be found in the _Migrations table in your database/schema.

Since Prisma 2.0 is released, will Prisma 1 still be maintained?

Yes, Prisma 1 will continue to be maintained. However, most Prisma engineering and support resources will go into the development of Prisma 2.0.

There will be no new features developed for Prisma 1.

Note that there will be dedicated tooling and detailed migration guides to help you with the setup.

Where can I get more information about the plans for Prisma?

Check out the specs repo which contains the technical specifications for future Prisma 2.0 features. Get involved by creating issues and sharing feedback!

How much does Prisma cost? What is the pricing model for Prisma?

Prisma is open source and using it is free of any charge! In the future, Prisma will offer additional cloud services to facilitate various database- and Prisma-related workflows. Note that these will be optional, Prisma can continue to be used without consuming any commercial services.

Edit this page on GitHub