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

Yes, Prisma Client provides two methods called $queryRaw and $executeRaw which you can use to send raw SQL to the database. Learn more about these in the docs here.

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
  • delete the migrations directory on your file system
  • drop the _prisma_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 contain a migration.sql file about the respective migration. The status of the migrations is tracked in the _prisma_migrations table in your database/schema. See migrate status.

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 Prisma road map for an overview of our priorities. 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