{"library":"pgpm","title":"PostgreSQL Package Manager CLI","description":"pgpm is a powerful and opinionated command-line interface (CLI) for managing PostgreSQL database schemas, migrations, and modules, akin to a package manager for your database. It is designed for modular PostgreSQL development, enabling the creation and management of reusable database packages with dependency resolution and semantic versioning. The tool features a deterministic migration engine, offering version-controlled, plan-driven deployments with rollback capabilities and idempotent execution. It supports recursive module resolution across workspaces and provides turnkey module-first workspaces ready for CI/CD, Docker, and end-to-end testing with TypeScript tooling. The current stable version is 4.16.3, and it appears to be actively maintained with a focus on robust and reproducible database development workflows.","language":"javascript","status":"active","last_verified":"Wed Apr 22","install":{"commands":["npm install pgpm"],"cli":{"name":"pgpm","version":null}},"imports":["import type { PgpmConfiguration } from 'pgpm'","import { deploy } from 'pgpm/commands'","import { initWorkspace } from 'pgpm/workspace'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"# Install pgpm globally\nnpm install -g pgpm\n\n# Start a local PostgreSQL instance using Docker and export environment variables\npgpm docker start\neval \"$(pgpm env)\"\n\n# Create a new pgpm workspace\npgpm init workspace my-app\ncd my-app\n\n# Create your first database module within the workspace\npgpm init packages/my-module\ncd packages/my-module\n\n# Add a sample migration (e.g., create a users table)\n# Create src/migrations/001_create_users_table.sql with content:\n/*\ncreate table users (\n  id serial primary key,\n  name text not null\n);\n*/\n\n# Return to the workspace root\ncd ../..\n\n# Deploy all changes and modules to the database, creating the database if it doesn't exist\npgpm deploy --createdb --database mydatabase\n\nconsole.log(\"pgpm workspace and initial module deployed successfully!\")","lang":"typescript","description":"Demonstrates global installation, starting a local PostgreSQL instance via Docker, initializing a workspace and a module, adding a basic migration, and deploying changes to the database.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}