Skip to content

Latest commit

 

History

History
153 lines (92 loc) · 5.72 KB

glossary.md

File metadata and controls

153 lines (92 loc) · 5.72 KB

Glossary

Table of contents

Terminology

Data source

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.

Data source client

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.

Data source connector

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 databases
  • postgresql: A connector for PostgreSQL databases
  • mysql: A connector for MySQL databases
  • mongo: A connector for MongoDB databases (coming soon)

Prisma Schema Language (PSL)

PSL is the name of the syntax used to write a schema file.

Learn more about PSL in the spec.

Generator

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.

Lift

A declarative data modeling and migration system. Learn more on the Lift website.

Migration

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.

Migration engine

The migration engine generates the database operations needed to apply a migration to a database.

Model

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.

Data model definition

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.

Nested write

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.

Photon

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.

Prisma schema file

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)

Scalar type

Also sometimes referred to as:

  • Scalar

Selection set

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:

The selection set can be manipulated by passing the select or include option to a Photon API call.

Type modifier

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.

Query engine

The query engine generates and optimizes database queries based on incoming requests from Photon.