Skip to content

Support PostgreSQL Extensions in the Prisma Schema Language #15627

Closed
prisma/prisma-engines
#3264

Description

@pimeys

Part of an epic.

Internal spec

Add a new extensions array to the datasource:

datasource mypg {
  provider   = "postgresql"
  url        = env("TEST_DATABASE_URL")
  extensions = [citext, postgis(schema: "geo", version: "2.1"), timescaledb]
}

generator client {
  ..
  previewFeatures = ["postgresqlExtensions"]
}

The provider must be postgres or postgresql.

The extension names are constants, they don't need to hold any arguments. Optionally a schema and version can be provided. Both must be strings.

Additionally, a preview feature postgresqlExtensions must be enabled to use the extensions in the datasource.

Issue is considered to be ready when the extension information is available conveniently in the configuration, and also easily usable in the parser database and dml structures.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions