pgpm export wrapper for agentic-db schema. Exports the provisioned agentic-db database as a pgpm-installable SQL module.
pgpminstalled globally (npm install -g pgpm)- A provisioned agentic-db database running locally (via
pnpm run provisioninpackages/provision) - PostgreSQL connection available (pgpm reads from
PGHOST,PGPORT,PGUSER,PGPASSWORDenv vars, or usespgpm env)
pnpm run export:interactivepnpm run exportThis runs pgpm export with:
--extensionName agentic-db— names the output moduleagentic-db--metaExtensionName agentic-db-services— names the services moduleagentic-db-services
pgpm exportconnects directly to the PostgreSQL database- Reads metadata from
collections_public.database,collections_public.schema - Reads migration history from
db_migrate.sql_actions - Uses
makeReplacer()to auto-rename schemas (e.g.agentic-db-<timestamp>-public->agentic_db_public) - Outputs a pgpm module with
deploy/,revert/,verify/,.control,pgpm.plan
The exported module lands in the pgpm workspace packages/ directory (configured by pgpm.json at repo root). You can then:
# Install the module into another database
pgpm install agentic-db
# Or publish it
pgpm packageMake sure pgpm env vars are set:
eval "$(pgpm env)"Or set them manually:
export PGHOST=localhost
export PGPORT=5432
export PGUSER=postgres
export PGPASSWORD=postgres