# prisma-engines

> 🚂 Engine components of Prisma 2+. This is copy of Brendonovich/prisma-engines

- Author: Yaroslav Koval (https://koval-dev.org/)
- Source: https://github.com/koval01/prisma-engines
- Clone: git clone https://github.com/koval01/prisma-engines.git
- Website: https://github.com/Brendonovich/prisma-engines
- Language: Rust
- License: Apache-2.0
- Last updated: 2025-01-11

## README (excerpt)

# Prisma Engines

This repository contains a collection of engines that power the core stack for
[Prisma](https://github.com/prisma/prisma), most prominently [Prisma
Client](https://www.prisma.io/client) and [Prisma
Migrate](https://www.prisma.io/migrate).

If you're looking for how to install Prisma or any of the engines, the [Getting
Started](https://www.prisma.io/docs/getting-started) guide might be useful.

This document describes some of the internals of the engines, and how to build
and test them.

## What's in this repository

This repository contains four engines:

- *Query engine*, used by the client to run database queries from Prisma Client
- *Migration engine*, used to create and run migrations
- *Introspection engine*, used to get the state of the database, compare it
    to the schema file, and figure out what the differences are
- *Prisma Format*, used to format prisma files

Additionally, the *psl* (Prisma Schema Language) is the library that defines how
the language looks like, how it's parsed, etc.

You'll also find:
- *libs*, for various (small) libraries such as macros, user facing errors,
    various connector/database-specific libraries, etc.
- a `docker-compose.yml` file that's helpful for running tests and bringing up
    containers for various databases
- a `flake.nix` file for bringing up all dependencies and making it easy to
    build the code in this repository (the use of this file and `nix` is
    entirely optional, but can be a good and easy way to get started)
- an `.envrc` file to make it easier to set everything up, including the `nix
    shell`

## Documentation

The [API docs (cargo doc)](https://prisma.github.io/prisma-engines/) are
published on our fabulous repo page.

## Building Prisma Engines

**Prerequisites:**

- Installed the stable Rust toolchain, at least version 1.52.0. You can get the
  toolchain at [rustup](https://rustup.rs/) or the package manager of your
  choice.
- Linux only: OpenSSL is required to be installed.
- Installed [direnv](https://github.com/direnv/direnv), then `direnv allow` on
  the repository root.
  - Make sure direnv is [hooked](https://direnv.net/docs/hook.html) into your shell
  - Alternatively: Load the defined environment in `./.envrc` manually in your
    shell.
- **For m1 users**: Install [Protocol Buffers](https://grpc.io/docs/protoc-installation/)

Note for nix users: it should be enough to `direnv allow`.
**How to build:**

[... continued on GitHub]
