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

  • 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,420+ 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.8.9.tar.gz (1.4 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.8.9-cp314-cp314-win_amd64.whl (734.3 kB view details)

Uploaded CPython 3.14Windows x86-64

fraiseql_confiture-0.8.9-cp313-cp313-win_amd64.whl (734.3 kB view details)

Uploaded CPython 3.13Windows x86-64

fraiseql_confiture-0.8.9-cp313-cp313-manylinux_2_28_x86_64.whl (826.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.9-cp313-cp313-macosx_11_0_arm64.whl (780.3 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fraiseql_confiture-0.8.9-cp312-cp312-win_amd64.whl (734.3 kB view details)

Uploaded CPython 3.12Windows x86-64

fraiseql_confiture-0.8.9-cp312-cp312-manylinux_2_28_x86_64.whl (826.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.9-cp312-cp312-macosx_11_0_arm64.whl (780.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fraiseql_confiture-0.8.9-cp311-cp311-win_amd64.whl (734.0 kB view details)

Uploaded CPython 3.11Windows x86-64

fraiseql_confiture-0.8.9-cp311-cp311-manylinux_2_28_x86_64.whl (827.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.9-cp311-cp311-macosx_11_0_arm64.whl (780.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.9.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.8.9.tar.gz
Algorithm Hash digest
SHA256 b5903b412e7c7357281be726ac4bea67650984c566cccdbb32249e970295d44f
MD5 50ece1dcd176f414327fa513c30f1dbd
BLAKE2b-256 7ba2f36fe4a347179c3374b29486c7e0da73af2694be00bc34f01ced3c269ed1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.9-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 734.3 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.8.9-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 1f84594d9eb719670193b8aad157d391a58250c50f174fce5259c393c1dd05ae
MD5 08372b86e761a722c36f31377eb5e7c6
BLAKE2b-256 d04d58ae36933e66db71bf7d8eea7215b257ce2a84aaa78b77461cdac0585f29

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.9-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 734.3 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.8.9-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 8e85fee3fc8b8f65dbcdfee99709015210acb0bc8c89b8635215961ed88d5bef
MD5 81c91b92e5a8194cbc298de439b412fe
BLAKE2b-256 354e58a6f15f67d6a3f566218550c17bd1ab5af468d1ec43c7171f69ae5ae237

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.9-cp313-cp313-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 826.2 kB
  • Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.8.9-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f81c37ac85237f0992e7798c7cbe61a981d10c307fc9bdd94eba2ba50c973fff
MD5 3c1c48d5e5715542464921f3b2899967
BLAKE2b-256 3606b4f74c3e6a1a831f6424296f505185cf30042d643b8cfba18ba83f1ca538

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.9-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 780.3 kB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.8.9-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1887a86e76b47834b58729a04e5ba096d7f639f43173e3c38984dfae84c90534
MD5 622d4b56d3c6b43f844bb465d1466f2c
BLAKE2b-256 1897a2c5050ead58a87f5124a1e541356090f65e65169e47cab2ed8547316124

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.9-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 734.3 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.8.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 59ae82d2472b4ce22454380fdc2a34aa6335aaf1b12ecacad11101ed3961871e
MD5 14b10a93e7e00719dc82d8bf252646bd
BLAKE2b-256 cb01c44a03aaaa1935d59e28ed5c18d70865371612a9ef2c557b296a8e0e7ea0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.9-cp312-cp312-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 826.3 kB
  • Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.8.9-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d5587a67ffd3254150571cd49b8d9a5b6231afcc1d167d8cc558e9899228b903
MD5 d199f42794a0c0fc435f4a1d3134e0ab
BLAKE2b-256 7c1381127c9ae982db01cd3394c9382162bcceaf9d2a06d41e6a67994d2929fd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.9-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 780.2 kB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.8.9-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 13acb69b5bfcd4ac8f68818d1627cdc98d7a9e8e0bfe789e499a0b8b719b4fa8
MD5 fb97fec2b2b805a2e340d2dc273c1074
BLAKE2b-256 31b6a33b9c95cfbd4098cb040f960058b034b43362cb46e89e1575ee1f0b27dd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.9-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 734.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.8.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 eb4d69df9d56b6199dfba5e18ec5156464c524260c806ab06f48e4250a87c185
MD5 391fe48397df133b715d434e15162c81
BLAKE2b-256 b0fc1988c8eb887893ff0d628a9eeb0ebab791c0ee32472a4effa6d1f277abb8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.9-cp311-cp311-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 827.8 kB
  • Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.8.9-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 98321d2d52d839197da8aeb853e57b40ce075a44b59c0b013f89564dcffde7a1
MD5 e0bb0c1b008319b5ea54c01560187a19
BLAKE2b-256 b7f2ee44a8cfc17b65c26d7274eb9b35413aa7fb0f4f1d953e1404cbc1647d1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.9-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 780.5 kB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.8.9-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 78f124afa94ac86b3ce44d72898f24cd12464965919913f5943f76e939fbff32
MD5 9cc66cf4da18a428e649e5f9bbb190eb
BLAKE2b-256 1897049a731823aba49e0dcba429a00952068941ea1b8a667dde54a605a2cc94

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