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.0.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.0-cp314-cp314-win_amd64.whl (785.1 kB view details)

Uploaded CPython 3.14Windows x86-64

fraiseql_confiture-0.9.0-cp313-cp313-win_amd64.whl (785.1 kB view details)

Uploaded CPython 3.13Windows x86-64

fraiseql_confiture-0.9.0-cp313-cp313-manylinux_2_28_x86_64.whl (877.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.9.0-cp313-cp313-macosx_11_0_arm64.whl (832.4 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fraiseql_confiture-0.9.0-cp312-cp312-win_amd64.whl (785.2 kB view details)

Uploaded CPython 3.12Windows x86-64

fraiseql_confiture-0.9.0-cp312-cp312-manylinux_2_28_x86_64.whl (878.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.9.0-cp312-cp312-macosx_11_0_arm64.whl (832.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fraiseql_confiture-0.9.0-cp311-cp311-win_amd64.whl (785.0 kB view details)

Uploaded CPython 3.11Windows x86-64

fraiseql_confiture-0.9.0-cp311-cp311-manylinux_2_28_x86_64.whl (879.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.9.0-cp311-cp311-macosx_11_0_arm64.whl (832.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.0.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.0.tar.gz
Algorithm Hash digest
SHA256 a068d0ad61a20add29e7b8bc7248a0f34e5569bbb08d0ed4e019507c371bb897
MD5 86ce3a1d78c7aa922c6a22104051cf85
BLAKE2b-256 d42abeed2a4f75899332d65de383cc994bf8025249268067fe28faed6e814836

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 785.1 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 c3b756cc26858d66ade13a4777c2697095752c28c97bb6a9f482a52269fd9b2e
MD5 488fbf284381fe1f6963ca8fd3ec6eac
BLAKE2b-256 0bc06813c51695568c899ecc3b31eedea4cf95f2e1867c1568e41b4ec49c6fac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 785.1 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5fbd64ede183e188a0bd6c69c912d6663cac35d38455c05bdb2649def416b46b
MD5 e2eac7b0d22a88ded5f2f63fe033a01d
BLAKE2b-256 83c03840152a91678a302f9f221e24d315deca053f9a83e8c2658255034c2b6e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.0-cp313-cp313-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 877.8 kB
  • Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bd6a386b2cb773721c63e099c3d279fb89ee8052c50a37e0ba677c94bc2bbe43
MD5 39a47b2fd012b6817c851cac9fa473d2
BLAKE2b-256 2061cd03e9f562718f6b0048b73799a684db44af444719c130937cbb7027d9b1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.0-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 832.4 kB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1bceff123348e2d17dec4a407a850ecf8b281dee74a50fbc0b78ba85b49749fd
MD5 011992c500ed2721cd4726e69d8ee3b6
BLAKE2b-256 1fd68c99a19bfbf868f322c5d1acf5b915feacb63d44646fb33372bcb8988d27

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 785.2 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d6a95f04a77d2755834e25e1551d48cfd1b52dc8f209dd021d88f0672c64b408
MD5 63f31d17ef7f715682b6cd40d229c714
BLAKE2b-256 c35f8863506949637466aabf9b24da87584faacd9519422c07330d6572f0eae3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.0-cp312-cp312-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 878.0 kB
  • Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b9636ce52c88a7537ba39ca353cae65a227ddd7f4398d009f88e02d8fff41bd8
MD5 6287f6113bd5b5af0d85893feff33c4e
BLAKE2b-256 03778f65f25cc0ddf7106169e632d451e2aa574e7b09c9d07b9ffef637e0f889

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.0-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 832.4 kB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2a847afcadc9b85c625cfb58f6429684ca681510b3dac8775f3bbd9a81a0c0c7
MD5 9204f9683a18b13e9e3c5fe3bcb5bd12
BLAKE2b-256 51bae32bbe16a063bacef170003014125efe3b8211811955884ded5f19ec38aa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 785.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e575cdac8235838f707ded902f0ec01fc1cfcca3d31d48a0ad806471bcee0262
MD5 4636299b092b43d045e1729ea00dc613
BLAKE2b-256 94f96ed2bc96e5d158be21eca120071444903e7a030484eed8808a8fb7ea2008

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.0-cp311-cp311-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 879.4 kB
  • Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7df0e29e3c9f7db0558529489d915520ac8224e823b73766c015cb33aade6f28
MD5 680c1b44fd8a7a8f0de2808605d74a09
BLAKE2b-256 7b499431f9a4876ad139614c4a4ec9c3af4cf1e5a629dd3be38caef44d29ca27

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.0-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 832.7 kB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e281964498e3e1e45e0005c2b320c9add1e7dabecdb932748bca40036a312af3
MD5 5f9a2911b87e88efe411533af72dcb7e
BLAKE2b-256 d5a7bf24045df9b322ebb32138a5e34292dfc8257bc25db4ede6da1b06811129

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