Prisma PostgreSQL Setup
A guide to switching your Prisma environment to PostgreSQL. This guide covers the essential XAMPP configuration required to enable the PostgreSQL drivers.
Configuration Workflow
Standard setup procedure.
-
1
Enable
pgsqlextensions in XAMPP. -
2
Set provider to postgresql in
schema.prisma. -
3
Update connection string in
.env. - 4 Run migrations.
XAMPP Requirement
XAMPP has PostgreSQL drivers disabled by default. You must enable them in php.ini.
// php/php.ini
extension=pgsql
extension=pdo_pgsql
* Remove the semicolon (;) to uncomment. Restart Apache after saving.
Schema Configuration
Define your datasource in schema.prisma.
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
}
Note: By default, Prisma PHP initializes with PostgreSQL settings.
Environment Variables
Configure your connection string in the .env file. Note that PostgreSQL URLs require a specific schema (usually public).
DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE?schema=public"
Connection Parameters
Setup Complete
Once your php.ini is updated and your environment variables are set, you are ready to push your schema to the database.