Skip to content

PostgreSQL

Drizby supports multiple PostgreSQL providers. Select the one that matches your setup.

Best for long-running Node.js servers.

Connection string:

postgresql://user:password@host:5432/database
FieldExample
Useradmin
Passwordsecret
Hostlocalhost
Port5432
Databasemydb

The classic pg driver.

Connection string:

postgresql://user:password@host:5432/database

For Neon serverless PostgreSQL.

Connection string:

postgresql://user:password@ep-cool-name-123456.us-east-2.aws.neon.tech/dbname?sslmode=require

Get your connection string from the Neon dashboard.

For Supabase hosted PostgreSQL. Uses the postgres.js driver.

Connection string:

postgresql://postgres.[project-ref]:[password]@aws-0-[region].pooler.supabase.com:6543/postgres

Get your connection string from Supabase → Settings → Database.

An embedded PostgreSQL that runs in-process — no server required.

Connection string:

file:data/my-pg-data

Data is stored on the local filesystem. Useful for development and testing.

For Amazon RDS clusters accessed via the Data API. Uses structured connection fields.

FieldRequiredDescription
Resource ARNYesARN of the RDS cluster
Secret ARNYesARN of the Secrets Manager secret
DatabaseYesDatabase name

For Amazon Aurora DSQL clusters. Uses token-based authentication with AWS credentials.

FieldRequiredDescription
HostYesCluster endpoint
UserYesUsername (typically admin)

Requires AWS credentials configured in your environment.

PostgreSQL schemas use pgTable and column types from drizzle-orm/pg-core:

import { pgTable, serial, text, integer, timestamp, real } from 'drizzle-orm/pg-core'
export const orders = pgTable('orders', {
id: serial('id').primaryKey(),
customerName: text('customer_name').notNull(),
amount: real('amount'),
quantity: integer('quantity'),
createdAt: timestamp('created_at').defaultNow()
})