Environment variables reference

This document describes different environment variables and their use cases.

Prisma Client

DEBUG

DEBUG is used to enable debugging output in the Prisma Client.

Example setting Prisma Client level debugging output:

$# enable only `prisma:client`-level debugging output
$export DEBUG="prisma:client"

See Debugging for more information.

NO_COLOR

NO_COLOR if truthy will activate the colorless setting for error formatting and strip colors from error messages.

See Formatting via environment variables for more information.

Prisma Studio

BROWSER

BROWSER is for Prisma Studio to force which browser it should be open in, if not set it will open in the default browser. It's also used as a flag when starting the studio from the CLI.

BROWSER=firefox prisma studio --port 5555
$prisma studio --browser firefox

See Studio documentation for more information.

Prisma CLI

PRISMA_HIDE_UPDATE_MESSAGE

PRISMA_HIDE_UPDATE_MESSAGE is used to hide the update notification message that is shown when a newer Prisma CLI version is available. It's a truthy value.

const shouldHide = process.env.PRISMA_HIDE_UPDATE_MESSAGE

PRISMA_GENERATE_SKIP_AUTOINSTALL

PRISMA_GENERATE_SKIP_AUTOINSTALL can be set to a truthy value to skip the auto-install of prisma CLI and @prisma/client dependencies (if they are missing), if the prisma-client-js generator is defined in the Prisma Schema, when using the prisma generate command.

PRISMA_DISABLE_WARNINGS

Disables all CLI warnings generated by logger.warn.

Proxy environment variables

The Prisma CLI supports custom HTTP(S) proxies to download the Prisma engines. These can be helpful to use when working behind a corporate firewall. See Using a HTTP proxy for the CLI for more information.

NO_PROXY

NO_PROXY is a comma-separated list of hostnames or IP addresses that do not require a proxy.

$NO_PROXY=myhostname.com,10.11.12.0/16,172.30.0.0/16

HTTP_PROXY

HTTP_PROXY is set with the hostname or IP address of a proxy server.

$HTTP_PROXY=http://proxy.example.com

HTTPS_PROXY

HTTPS_PROXY is set with the hostname or IP address of a proxy server.

$HTTPS_PROXY=https://proxy.example.com

Engine environment variables

Configuring Query Engine Type

PRISMA_CLI_QUERY_ENGINE_TYPE

PRISMA_CLI_QUERY_ENGINE_TYPE is used to define the query engine type Prisma CLI downloads and uses. Defaults to library, but can be set to binary:

PRISMA_CLI_QUERY_ENGINE_TYPE=binary

PRISMA_CLIENT_ENGINE_TYPE

PRISMA_CLIENT_ENGINE_TYPE is used to define the query engine type Prisma Client downloads and uses. Defaults to library, but can be set to binary:

PRISMA_CLIENT_ENGINE_TYPE=binary

Note: You need to generate your Prisma Client after setting this variable for the configuration to take effect and the libraries to be downloaded. Otherwise, the Prisma Client will be missing the appropriate query engine library and you will have to define their location using PRISMA_QUERY_ENGINE_LIBRARY.

It is the environment variable equivalent for the engineType property of the generator block which enables you to define the same setting in your Prisma Schema.

Downloading Engines

PRISMA_ENGINES_MIRROR

PRISMA_ENGINES_MIRROR can be used to specify a custom CDN (or server) endpoint to download the engines files for the CLI/Client. The default value is https://binaries.prisma.sh, where Prisma hosts the engine files.

$PRISMA_ENGINES_MIRROR=https://example.org/custom-engines/

See Prisma engines for a conceptual overview of how to use this environment variable.

Note: This environment variable used to be available as PRISMA_BINARY_MIRROR, which was deprecated in Prisma 3.0.1. It is discouraged to use anymore and will be removed in the future.

Custom engine file locations

By default, all engine files are downloaded when you install Prisma CLI, copied when generating Prisma Client, and put into known locations. There are however situations where you may want to use a custom engine file from custom locations:

PRISMA_QUERY_ENGINE_BINARY

PRISMA_QUERY_ENGINE_BINARY is used to set a custom location for your own query engine binary.

$PRISMA_QUERY_ENGINE_BINARY=custom/my-query-engine-unix

For Prisma CLI it allows you to define the query engine file to be used.
For Prisma Client, on build time (during prisma generate), it defines where the query engine file will be copied from into the Prisma Client. At run time (when using the generated Client) it can be used to define the specific query engine file to be used instead of the included one.

Note: This can only have an effect if the engine type of CLI or Client are set to binary

PRISMA_QUERY_ENGINE_LIBRARY

PRISMA_QUERY_ENGINE_LIBRARY is used to set a custom location for your own query engine library.

$PRISMA_QUERY_ENGINE_LIBRARY=custom/my-query-engine-unix

For Prisma CLI it allows you to define the query engine file to be used.
For Prisma Client, on build time (during prisma generate), it defines where the query engine file will be copied from into the Prisma Client. At run time (when using the generated Client) it can be used to define the specific query engine file to be used instead of the included one.

Note: This can only have an effect if the engine type of CLI or Client are set to library

PRISMA_MIGRATION_ENGINE_BINARY

PRISMA_MIGRATION_ENGINE_BINARY is used to set a custom location for your own migration engine binary.

$PRISMA_MIGRATION_ENGINE_BINARY=custom/my-migration-engine-unix

PRISMA_INTROSPECTION_ENGINE_BINARY

PRISMA_INTROSPECTION_ENGINE_BINARY is used to set a custom location for your own introspection engine binary.

$PRISMA_INTROSPECTION_ENGINE_BINARY=custom/my-introspection-engine-unix

PRISMA_FMT_BINARY

PRISMA_FMT_BINARY is used to set a custom location for your own format engine binary.

$PRISMA_FMT_BINARY=custom/my-custom-format-engine-unix

CLI Binary Targets

PRISMA_CLI_BINARY_TARGETS

PRISMA_CLI_BINARY_TARGETS can be used to specify one or more binary targets that the CLI will download, it must be provided during npm install.

For example: If you are on macOS, the binary target is darwin & AWS Lambda target is rhel-openssl-1.0.x

$PRISMA_CLI_BINARY_TARGETS=darwin,rhel-openssl-1.0.x npm install

This is the Prisma CLI equivalent for the binaryTargets property of the generator block which enables you to define the same setting for Prisma Client

Edit this page on GitHub