Skip to content

Postgres migrations made easy

Notifications You must be signed in to change notification settings

supabase/pg-toolbelt

Repository files navigation

pg-toolbelt

Monorepo for Supabase PostgreSQL tooling.

Packages

Package Description npm
@supabase/pg-delta PostgreSQL schema diff and migration tool npm
@supabase/pg-topo Topological sorting for SQL DDL statements npm

Development

Prerequisites

  • Bun (latest)
  • Docker (for integration tests)
  • Node.js >= 20 (for TypeScript compilation)

Setup

bun install

Commands

bun run build           # Build all packages
bun run test            # Test all packages
bun run test:pg-delta   # Test pg-delta only
bun run test:pg-topo    # Test pg-topo only
bun run check-types     # Type check all packages
bun run format-and-lint # Format and lint all code

Working with individual packages

# pg-delta
cd packages/pg-delta
bun test src/           # Unit tests only
bun test tests/         # Integration tests only (requires Docker)

# pg-topo
cd packages/pg-topo
bun test                # All tests (requires Docker)

Releasing

This monorepo uses changesets for versioning.

bunx changeset          # Create a changeset
bun run version         # Apply changesets to update versions
bunx changeset publish  # Publish to npm

License

MIT

About

Postgres migrations made easy

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors