Skip to main content
The *pac tool family

Define the state.Ship the difference.

*pac (pronounced “Starpac”) is a family of focused desired-state database tools: pgpac for PostgreSQL and d1pac for Cloudflare D1.

Coming from SQL Server? Think DACPAC-style intent, built around each database's native SQL.

desired/SQL source
Tables/accounts.sql
Views/active_accounts.sql
Indexes/accounts_status.sql
CREATE TABLE accounts ( id integer PRIMARY KEY, status text );
*pac plan
UPDATE PLAN READY
+create table account_events01
~alter table accounts02
+create index accounts_status03
desiredlive3 operations

The *pac loop

From desired state to database update.

01Describe

Write the database you want

Keep the desired schema as ordinary SQL. Database changes become readable source-control changes.

pgpac buildd1pac build
02Compare

See the exact path forward

Compare the immutable package with the live database and produce an ordered, inspectable plan.

pgpac pland1pac plan
03Converge

Update reality to match

Apply the reviewed delta. Potentially destructive operations stay behind explicit safety gates.

pgpac applyd1pac apply

A familiar idea, engine-native execution

Manage intent, not a pile of instructions.

If you know DACPAC, the mental model will feel familiar: package a declarative database model, compare it to a target, then publish the delta.

Explore pgpac documentation
IN GITDesired stateversioned SQL
compareΔreview
DATABASELive stateupdated safely
01

SQL stays SQL

No proprietary schema language. Your database definition remains readable by people and its native engine.

02

Drift is visible

The live target is part of every comparison, so a plan starts from reality—not an assumption.

03

CI-friendly by design

Build once, inspect text or JSON plans, then promote the same package through environments.

Your schema already has a destination.

Make it the source of truth.