- Data source
- Data source client
- Data source connector
- Prisma Schema Language (PSL)
- Embed
- Generator
- Lift
- Migration
- Migration engine
- Model
- Data model definition
- Nested write
- Photon
- Prisma schema file
- Scalar type
- Selection set
- Type modifier
- Query engine
A data source can be anything that Prisma can connect to via a connector, e.g. a database, a GraphQL API, a REST API or a 3rd-party service.
A data source client provides a type-safe data access API for a data source. Depending on the data source, the API can be read-only, write-only or allow both. Note that the most common data source connectors allows for both.
Also sometimes referred to as:
- Connector
A data source connector connects Prisma to a data source.
Prisma currently supports the following built-in connectors:
sqlite
: A connector for SQLite databasespostgresql
: A connector for PostgreSQL databasesmysql
: A connector for MySQL databasesmongo
: A connector for MongoDB databases (coming soon)
PSL is the name of the syntax used to write a schema file.
Learn more about PSL in the spec.
Also sometimes referred to as:
- Embedded type
- Embedded model
- Embedded structure
Embeds are defined via the embed
blocks in the data model and define structures that are embedded in a model. For a relational database this is often called an embedded type, for document databases, an embedded document.
A generator determines what kind of code should be generated from the data model. For example, you can specify the Photon JS generator to generate Photon JS as a type-safe database client based on the data model.
You can include various generators in your schema file. When running prisma2 generate
, the Prisma CLI reads the specified generators from the Prisma schema and invokes each of them.
A declarative data modeling and migration system. Learn more on the Lift website.
Also sometimes referred to as:
- Database migration
- Schema migration
A migration is a concept from Lift. It refers to the transition from a data model state to another data model state.
The migration engine generates the database operations needed to apply a migration to a database.
Models represent the entities of your application domain. They directly map to structures in the underlying data source, e.g. a table for a relational database or a collection for a document database. The generated Photon API will expose CRUD operations for each model in your data model.
Also sometimes referred to as:
- Data model (or datamodel)
- Prisma schema
- Application schema
- Model schema
Contains the definitions of all your models. The data model definition is part of the schema file.
Photon lets you perform nested creates, nested updates and nested connects for related models. A nested write is always performed as an atomic transaction. Learn more about the generated Photon API here.
An auto-generated and type-safe database client. Photon is generated using a generator that's specified in your schema file. The generated Photon API exposes powerful CRUD operations for you to programmatically access your database.
Prisma currently supports the following languages for Photon:
- JavaScript (Node.js)
- TypeScript
A generator for Go is coming soon.
Also sometimes referred to as:
- Schema file
- Project file
- Prisma file
- Prisma schema
The Prisma schema file specifies the main parts of your Prisma setup:
- Data sources: Specify the details of the data sources Prisma should connect to (e.g. a PostgreSQL database)
- Data model definition: Specifies the shape of the data per data source
- Generators: Specifies what data source clients should be generated (e.g. Photon JS)
Also sometimes referred to as:
- Scalar
Also sometimes referred to as:
- Payload
Determines what fields of a model are returned in a Photon API call. By default, the selection set contains the fields of the following types:
- non-lazy scalar fields
- enums
- embed fields
The selection set can be manipulated by passing the select
or include
option to a Photon API call.
Type modifiers let you turn the type of a field on a model. There are two type modifiers: []
for lists and ?
to make a field optional.
The query engine generates and optimizes database queries based on incoming requests from Photon.