https://github.com/supabase/pg-toolbelt
Postgres migrations made easy
https://github.com/supabase/pg-toolbelt
Last synced: 3 months ago
JSON representation
Postgres migrations made easy
- Host: GitHub
- URL: https://github.com/supabase/pg-toolbelt
- Owner: supabase
- Created: 2025-05-23T15:35:11.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-04-16T18:21:16.000Z (4 months ago)
- Last Synced: 2026-04-16T19:37:16.873Z (4 months ago)
- Language: TypeScript
- Size: 2.92 MB
- Stars: 41
- Watchers: 0
- Forks: 6
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
- Agents: AGENTS.md
Awesome Lists containing this project
README
# pg-toolbelt
Monorepo for Supabase PostgreSQL tooling.
## Packages
| Package | Description | npm |
|---------|-------------|-----|
| [`@supabase/pg-delta`](./packages/pg-delta) | PostgreSQL schema diff and migration tool | [](https://www.npmjs.com/package/@supabase/pg-delta) |
| [`@supabase/pg-topo`](./packages/pg-topo) | Topological sorting for SQL DDL statements | [](https://www.npmjs.com/package/@supabase/pg-topo) |
## Development
### Prerequisites
- [Bun](https://bun.sh) (latest)
- [Docker](https://www.docker.com/) (for integration tests)
- Node.js >= 20 (for TypeScript compilation)
### Setup
```bash
bun install
```
### Commands
```bash
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
```bash
# pg-delta
cd packages/pg-delta
bun run test src/ # Unit tests only
bun run test tests/ # Integration tests only (requires Docker)
# pg-topo
cd packages/pg-topo
bun run test # All tests (requires Docker)
```
### Releasing
This monorepo uses [changesets](https://github.com/changesets/changesets) for versioning.
```bash
bunx changeset # Create a changeset
bun run version # Apply changesets to update versions
bunx changeset publish # Publish to npm
```
## Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md) before opening a pull request.
- Open an issue first.
- Wait for maintainer triage via one of `✨ Feature`, `🐛 Bug`, `📘 Docs`, or `🛠️ Chore`.
- Then open a pull request.
Use [ISSUES.md](./ISSUES.md) for issue-writing guidance, especially for `pg-delta` reproductions.
## License
MIT