PostgreSQL schema evolution with built-in multi-agent coordination 🍓
Project description
Confiture 🍓
PostgreSQL migrations, sweetly done.
Build fresh databases in <1 second. Apply incremental migrations. Sync production data with PII anonymization. Zero-downtime schema swaps via FDW. All from the same tool.
Why Confiture?
- DDL is the source of truth — your
db/schema/directory defines the database, not a chain of migrations. Fresh databases build in <1 second by executing DDL directly. - Timestamp-based versioning — migration filenames use
YYYYMMDDHHMMSS, so parallel branches never collide. No more003_add_usersmerge conflicts. - 4 strategies, one tool — build from DDL, incremental migrations, production sync with anonymization, and zero-downtime schema-to-schema via FDW. Pick the right one for each situation.
- Multi-agent coordination — built-in intent registration and conflict detection so teams and AI agents don't step on each other's schema changes.
- CI/CD-native — semantic exit codes, structured output (JSON/CSV/YAML), distributed locking, and dry-run with SAVEPOINT testing.
Quick Start
Installation
pip install fraiseql-confiture
# Recommended: include pglast for large-schema support
# (uses PostgreSQL's own C parser — no token limits)
pip install "fraiseql-confiture[ast]"
CLI
# Initialize project structure
confiture init
# Write your schema DDL files
vim db/schema/10_tables/users.sql
# Build database from DDL (<1 second)
confiture build --env local
# Generate and apply migrations
confiture migrate generate --name "add_bio"
confiture migrate up
Library API
from confiture import Migrator
with Migrator.from_config("db/environments/prod.yaml") as m:
status = m.status()
if status.has_pending:
result = m.up()
The Four Strategies
| Strategy | Use Case | Command |
|---|---|---|
| Build from DDL | Fresh databases, testing, CI | confiture build --env local |
| Incremental Migrations | Existing databases, production | confiture migrate up |
| Production Sync | Copy data with PII anonymization | confiture sync --from prod --anonymize users.email |
| Zero-Downtime | Complex migrations via FDW | confiture migrate schema-to-schema |
Features
Migration Management
migrate preflight— pre-deploy safety gate: checks reversibility, non-transactional statements, duplicate versions, and checksum tampering. JSON output for CI/CD.- Semantic exit codes —
0success,2validation error,3SQL failure,6lock contention. Script with confidence. migrate rebuild— drop and recreate from DDL + replay migrations in one command. Fast environment reset.migrate validate— naming convention checks, schema drift detection, function signature and body drift.migrate fix-signatures— detect and atomically fix stale function overloads and body drift.- Dry-run with SAVEPOINT testing —
--dry-run-executeruns migrations inside a savepoint, then rolls back. - Checksum verification — detect tampered migration files before applying.
- Distributed locking — safe concurrent deployments via PostgreSQL advisory locks.
- Migration hooks — run custom logic before/after each migration.
Schema Intelligence
- Schema diff detection — two-tier parser: pglast (PostgreSQL's C parser) primary, sqlparse fallback.
- Schema linting — configurable rules to catch common DDL mistakes.
- Function introspection —
FunctionIntrospector,TypeMapper, andDependencyGraphfor deep schema analysis. - Grant accompaniment checker — detect permission changes without corresponding migrations.
Seed Data
- Sequential execution — handles PostgreSQL parser limits on large seed files.
- Per-file savepoint isolation — one bad seed file doesn't ruin the batch.
- 5-level prep-seed validation — static analysis through full execution, pre-commit safe at levels 1-3.
Multi-Agent Coordination
- Intent registration — declare which tables you're changing before you start.
- Conflict detection — automatic alerts when agents touch overlapping tables.
- JSON output — machine-readable for CI/CD pipelines.
Developer Experience
- Structured output — JSON, CSV, and YAML for all commands.
- Exception hierarchy — typed errors with error codes and resolution hints.
- Git-aware validation — detect schema drift vs. main branch, enforce migrations for DDL changes.
- PII anonymization — built-in strategies for production sync.
- Optional Rust extension — drop-in performance boost for SQL parsing and hashing.
- Python 3.11, 3.12, 3.13 — tested across all supported versions.
- 4,480+ tests passing.
Documentation
Getting Started: docs/getting-started.md
Guides:
- Build from DDL
- Incremental Migrations
- Production Data Sync
- Zero-Downtime Migrations
- Sequential Seed Execution
- Multi-Agent Coordination
- Prep-Seed Validation
- Migration Decision Tree
- Dry-Run Mode
CLI Reference: docs/reference/cli.md
API Reference: docs/reference/
Examples: examples/
Contributing
git clone https://github.com/fraiseql/confiture.git
cd confiture
uv sync --all-extras
uv run pytest
See CONTRIBUTING.md and CLAUDE.md.
Author & License
Vibe-engineered by Lionel Hamayon 🍓
MIT License - Copyright (c) 2025 Lionel Hamayon
Making jam from strawberries, one migration at a time. 🍓→🍯
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fraiseql_confiture-0.8.17.tar.gz.
File metadata
- Download URL: fraiseql_confiture-0.8.17.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
457a8aa2270e1c66b64e6aca92fad3602302fd9b23d0fc9cff7beb257079c178
|
|
| MD5 |
1ae53230af59db7a9af2f667fa3ca582
|
|
| BLAKE2b-256 |
ee7bc6838e9e7f9963236af28fe4eea504c86ebeadb975495b13151b3156ccfa
|
File details
Details for the file fraiseql_confiture-0.8.17-cp314-cp314-win_amd64.whl.
File metadata
- Download URL: fraiseql_confiture-0.8.17-cp314-cp314-win_amd64.whl
- Upload date:
- Size: 750.2 kB
- Tags: CPython 3.14, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b5e60f295250008a2c9b080a3a4f4165db29998115efc173ffabb0901dccd19
|
|
| MD5 |
e6352c1413c623c534bc5ff7e9f5430f
|
|
| BLAKE2b-256 |
acc61d6066779ae5bfe2bb90b8dd3e14c051897f85873e2244ec4edf4da19240
|
File details
Details for the file fraiseql_confiture-0.8.17-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: fraiseql_confiture-0.8.17-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 750.2 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f0f0f04cca5f8778295a02b583ed314e8c7a7e52dae6c666c2047562cb1bbf4
|
|
| MD5 |
35931096d3778b01bc497ccd83bdfb99
|
|
| BLAKE2b-256 |
d4b2d38ba485c4f920df2bd57ad17a64047cc67f7e97fa4964eb67705c32f696
|
File details
Details for the file fraiseql_confiture-0.8.17-cp313-cp313-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: fraiseql_confiture-0.8.17-cp313-cp313-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 842.0 kB
- Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e760169e30597ffb5136a80b003471ba21c562c8613a3f986b124595e34df89
|
|
| MD5 |
1a4eebce507a75abd6d9ecb1bf44a005
|
|
| BLAKE2b-256 |
550d7c72347ed0c2002ef74805903c186c5d7dad0fa30a14d084452b9755797f
|
File details
Details for the file fraiseql_confiture-0.8.17-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: fraiseql_confiture-0.8.17-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 796.0 kB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2dcbf8864bde21d71a81e051c3e92ded811bf0da542fd440500ad505bc250f6f
|
|
| MD5 |
70002a5ba9fb6f7756a8fecfca5a9b38
|
|
| BLAKE2b-256 |
51600c0d53eacdf0513f4d258df49b9fd64b62c029ad37b32db1ea9366d41227
|
File details
Details for the file fraiseql_confiture-0.8.17-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: fraiseql_confiture-0.8.17-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 750.2 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c8a53fe4b4607bb579729fc12c76cfad4fd4b443e85f7c0e9b066a81ecf90cd
|
|
| MD5 |
46f81e1bc669b6939d9497314c2def1e
|
|
| BLAKE2b-256 |
167a872ed758727a3b4ab04d2a0e35fd9047a7258e5e45f3494ffbefcf49046a
|
File details
Details for the file fraiseql_confiture-0.8.17-cp312-cp312-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: fraiseql_confiture-0.8.17-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 842.1 kB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22dcfccd5b959946c9c89b5e57c6f2e809cceba902885fbb2009a794f29683eb
|
|
| MD5 |
8e80c72be3c32916d4de08b683b02c8b
|
|
| BLAKE2b-256 |
050334d8fd86ca3e959025821a152b6d9660b7e0faec2f3f8303e34dcf770400
|
File details
Details for the file fraiseql_confiture-0.8.17-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: fraiseql_confiture-0.8.17-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 796.0 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29ba2ca6eae71fc0b21814778ab7b768d3de93ce11de3c6458b7fd04c2813c2a
|
|
| MD5 |
acbd076360d901f120d5c0ce68d15ef9
|
|
| BLAKE2b-256 |
8b8b4f6ce14c4dad6b5730a7ca856308f9f780e83a9512402ce2edb4c8c9dd68
|
File details
Details for the file fraiseql_confiture-0.8.17-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: fraiseql_confiture-0.8.17-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 749.9 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04d109a9980f09870b5374d30caaa24698e191d967dc6d2e4dc64d18ad40700c
|
|
| MD5 |
34af07fcb313a19f07b754efe6c3ed30
|
|
| BLAKE2b-256 |
9436354bc82740ec19b620ae5a13316f2f724ec941708c9c32116d9ba4d6011c
|
File details
Details for the file fraiseql_confiture-0.8.17-cp311-cp311-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: fraiseql_confiture-0.8.17-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 843.5 kB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd3cd96c5cd81a691c37c5734fbad56d9f9d4a6530b8702e89268a94576d0fa9
|
|
| MD5 |
3c54d617827c7308c7deed6e938d4b48
|
|
| BLAKE2b-256 |
23c4635edcab14827e8451f305c14fbb8df82720cf441ffdfaf8cc3b82fedb97
|
File details
Details for the file fraiseql_confiture-0.8.17-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: fraiseql_confiture-0.8.17-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 796.3 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe2cdb02b637218d87b86bf8c29b6827227fc23923006e79a759a49b72dd90ac
|
|
| MD5 |
e23e729c41fc5dc79095b70881fb2ab1
|
|
| BLAKE2b-256 |
755424d242bb0031ed8e64aec849c1ed43612f6762707c1c664c992177231b54
|