Declarative Data Modeling

The intuitive SDL syntax makes it easy for developers and domain experts to collaboratively model the application domain.

Use GraphQL SDL to model any database

Design your domain model using a simple expressive syntax called SDL. It is easy to learn and allows you to express everything from simple scalar types to relations and embedded documents.

type User {
  id: ID! @unique
  name: String!
  email: String! @unique
  isAdmin: Boolean @default(value: "false")
}

type Post {
  id: ID! @unique
  title: String!
}

Use Prisma to automatically migrate your database

You can deploy your data model changes via the CLI to automatically migrate the database and update the generated GraphQL API

Learn more about migrations
type User {
  id: ID! @unique
  createdAt: DateTime!
  name: String!
  admin: Boolean! @default(value: "true")
}
Datamodel in GRAPHQL SDL
CREATE TABLE User(
    `id` CHAR(25),
    `createdAt` DATETIME NOT NULL DEFAULT CURRENT
    `updatedAt` DATETIME NOT NULL DEFAULT CURRENT
    `name` MEDIUMTEXT NOT NULL,
    `admin` BOOLEAN NOT NULL DEFAULT TRUE,
    PRIMARY KEY (`id`),
    UNIQUE INDEX `id_UNIQUE` (`id` ASC)
)
Generated SQL
prisma deploy

Works across any kind of
database

Use the database of your choice. Prisma works the same no matter if you use a relational database like Postgres, a document database like MongoDB Coming Soon or something more exotic.

  • Currently supports Postgres and MySQL
  • Familiar API for all databases

Automatic migrations

Changing your data model is as simple as updating your datamodel.graphql file. The prisma CLI inspects your deployed service and generates a visual diff of all changes.

  • Flexible database migrations
  • Intuitive visual diff

Version control your
datamodel

Prisma uses standard GraphQL SDL to describe the data model. This makes it seamless to work with in any tool that supports GraphQL such as Github, the GraphQL Playground and most editors.

  • Based on standard GraphQL SDL
  • Works with all editors and development tools

Getting Started with Prisma

Follow the quickstart to explore Prisma on your own machine

Quickstart