Skip to main content

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.

PyPI Quality Gate Python 3.11+ PostgreSQL 12+ License: MIT


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 more 003_add_users merge 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 codes0 success, 2 validation error, 3 SQL failure, 6 lock 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-execute runs 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 introspectionFunctionIntrospector, TypeMapper, and DependencyGraph for 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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fraiseql_confiture-0.9.4.tar.gz (1.5 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fraiseql_confiture-0.9.4-cp314-cp314-win_amd64.whl (794.3 kB view details)

Uploaded CPython 3.14Windows x86-64

fraiseql_confiture-0.9.4-cp313-cp313-win_amd64.whl (794.3 kB view details)

Uploaded CPython 3.13Windows x86-64

fraiseql_confiture-0.9.4-cp313-cp313-manylinux_2_28_x86_64.whl (887.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.9.4-cp313-cp313-macosx_11_0_arm64.whl (841.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fraiseql_confiture-0.9.4-cp312-cp312-win_amd64.whl (794.4 kB view details)

Uploaded CPython 3.12Windows x86-64

fraiseql_confiture-0.9.4-cp312-cp312-manylinux_2_28_x86_64.whl (887.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.9.4-cp312-cp312-macosx_11_0_arm64.whl (841.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fraiseql_confiture-0.9.4-cp311-cp311-win_amd64.whl (794.2 kB view details)

Uploaded CPython 3.11Windows x86-64

fraiseql_confiture-0.9.4-cp311-cp311-manylinux_2_28_x86_64.whl (888.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.9.4-cp311-cp311-macosx_11_0_arm64.whl (841.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file fraiseql_confiture-0.9.4.tar.gz.

File metadata

  • Download URL: fraiseql_confiture-0.9.4.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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

Hashes for fraiseql_confiture-0.9.4.tar.gz
Algorithm Hash digest
SHA256 5f73489780d40b3e0d726cc01e48dac0cd7a27fe7e5d62c9829026642b0cb309
MD5 b7ff31fd34a82362f1b1e49764fddfee
BLAKE2b-256 f4034499e8c1a7d1b810574d9998199dc43440b33e11d3b9d287484c3c281c22

See more details on using hashes here.

File details

Details for the file fraiseql_confiture-0.9.4-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: fraiseql_confiture-0.9.4-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 794.3 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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

Hashes for fraiseql_confiture-0.9.4-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 da9d6294f119ac45660f6ba6c2386005f25c23bd0189699721739113e7ff94ae
MD5 cb1f6453dcbb45898d139101d0c93b93
BLAKE2b-256 8f396a1a7274d11d27f38f033f31157380ed336c5e58a2edd2eb022111b97006

See more details on using hashes here.

File details

Details for the file fraiseql_confiture-0.9.4-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: fraiseql_confiture-0.9.4-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 794.3 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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

Hashes for fraiseql_confiture-0.9.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 b38bcbbc75e86fd3c175905c06eceb86b82184baaa2c97406a4424f9c7f7d096
MD5 0bf9d9ffc53093114242c294bb9034cd
BLAKE2b-256 d8e50840c7498f0a41a88e34d9b724da8e5b4d82851ae14a21f794821c2448fb

See more details on using hashes here.

File details

Details for the file fraiseql_confiture-0.9.4-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: fraiseql_confiture-0.9.4-cp313-cp313-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 887.1 kB
  • Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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

Hashes for fraiseql_confiture-0.9.4-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d5296d6fbba226210d4e8180e32ccd2e83176a6e71cb104828fcb37c3fcf8acf
MD5 30add5f7beb6c8ca1c0161831bd2abb6
BLAKE2b-256 829820cfadc8c0498105b67904cd476308048ac060106f7aff9dbe8d3b43dec0

See more details on using hashes here.

File details

Details for the file fraiseql_confiture-0.9.4-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fraiseql_confiture-0.9.4-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 841.5 kB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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

Hashes for fraiseql_confiture-0.9.4-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9543f27eef51a9617622da3a49b91ed6e6d354cbb951a3fc079600c0d570ea87
MD5 1e79c2214f092f5d1c432aed8b426d6a
BLAKE2b-256 2b9c86f32bcf7a2f7b3252fce4f1aad199f34310e95d08066809359cc7f7ab59

See more details on using hashes here.

File details

Details for the file fraiseql_confiture-0.9.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: fraiseql_confiture-0.9.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 794.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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

Hashes for fraiseql_confiture-0.9.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 fef3cb017d7ef39d8305fa94c7c55305a13a3ec48bf73add425d5f6e5155d93e
MD5 b35d067c0a041f16926a10b66393a5d0
BLAKE2b-256 94a5114ae0156410f98f9921952fca6947da099da58d781350bb54f00aa781c3

See more details on using hashes here.

File details

Details for the file fraiseql_confiture-0.9.4-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: fraiseql_confiture-0.9.4-cp312-cp312-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 887.2 kB
  • Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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

Hashes for fraiseql_confiture-0.9.4-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 84a4045d55bfd5984d5dbb016e27c3aae46ac8338f2d4b0d26aba486ff0ce878
MD5 ad402e78b0ef297462f46bcf7cf07ac4
BLAKE2b-256 ee58ec2034c99c3cda2c80594addbf67f3fad052df0a3be1318eb43a49152fc9

See more details on using hashes here.

File details

Details for the file fraiseql_confiture-0.9.4-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fraiseql_confiture-0.9.4-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 841.5 kB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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

Hashes for fraiseql_confiture-0.9.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 30adb49d2a156189950970455d21503c790711cbb0b55e1ea6a4d785edeeb122
MD5 f25097092d8d86a4fb5f883c5afb9409
BLAKE2b-256 5a45591687cb6ddee173cbcaa755eb86f52548ef1723710121901b49d21bced1

See more details on using hashes here.

File details

Details for the file fraiseql_confiture-0.9.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: fraiseql_confiture-0.9.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 794.2 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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

Hashes for fraiseql_confiture-0.9.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fba4ab8db8b3445495e016781cdc52551cc3077c3585ead342362070d6a8232a
MD5 df5a7bc8108963ad36b12364d64147bb
BLAKE2b-256 307a665990091e84308d15d462beeca7f4a58fe4bda29f7bb81c1aae404ee51a

See more details on using hashes here.

File details

Details for the file fraiseql_confiture-0.9.4-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: fraiseql_confiture-0.9.4-cp311-cp311-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 888.6 kB
  • Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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

Hashes for fraiseql_confiture-0.9.4-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 106a17ae1319a851e269ee8a1d408948680c25e2deac61f2ce14aa9e0ed7f87c
MD5 ef1c5246383cd8c77f7c70a0c4711cbf
BLAKE2b-256 fae2235ed7138ad4c7dc1e256a61a32ea7b359b05a221ba04af24a47fc427538

See more details on using hashes here.

File details

Details for the file fraiseql_confiture-0.9.4-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

  • Download URL: fraiseql_confiture-0.9.4-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 841.8 kB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","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

Hashes for fraiseql_confiture-0.9.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5ab01ea5e3ae80c8daeab738994ec45ceb21f2cc0c145cb5e17762d3c0232e40
MD5 5ab6cc8158dcfc11e852b5ac0f60f429
BLAKE2b-256 2791173bdf23153aeb3e2fa86fa48f947f9f2b6449a8a4c4969becb9e353964d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page