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

Uploaded CPython 3.14Windows x86-64

fraiseql_confiture-0.8.16-cp313-cp313-win_amd64.whl (749.1 kB view details)

Uploaded CPython 3.13Windows x86-64

fraiseql_confiture-0.8.16-cp313-cp313-manylinux_2_28_x86_64.whl (840.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.16-cp313-cp313-macosx_11_0_arm64.whl (795.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fraiseql_confiture-0.8.16-cp312-cp312-win_amd64.whl (749.1 kB view details)

Uploaded CPython 3.12Windows x86-64

fraiseql_confiture-0.8.16-cp312-cp312-manylinux_2_28_x86_64.whl (841.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.16-cp312-cp312-macosx_11_0_arm64.whl (794.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fraiseql_confiture-0.8.16-cp311-cp311-win_amd64.whl (748.8 kB view details)

Uploaded CPython 3.11Windows x86-64

fraiseql_confiture-0.8.16-cp311-cp311-manylinux_2_28_x86_64.whl (842.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.16-cp311-cp311-macosx_11_0_arm64.whl (795.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.16.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

Hashes for fraiseql_confiture-0.8.16.tar.gz
Algorithm Hash digest
SHA256 e28137f8fbc836ca05d67e6bb4fca7f8c3dd3d82203d659a263bfbdb5fe1af26
MD5 4fc173e65f1fc2315b52ef4a5fa42c61
BLAKE2b-256 f524f84e707bcf3e5ad809052141e2205ed361cc077071980273ff85d419737f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.16-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 749.1 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

Hashes for fraiseql_confiture-0.8.16-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 cd5eca284b0b7b25a73a0fc561ea428af1a4051801321e85d3bde72677a98b27
MD5 7d2c63c48de8998684648c07305e1524
BLAKE2b-256 e6499521908e94867ec57a3babec180892a0582a1fb804c2651ef21db1ffade5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.16-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 749.1 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

Hashes for fraiseql_confiture-0.8.16-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d8d82483f1ef4eb95a37c1397177e332f2f053966b576216f5fd93be3159efb0
MD5 80a1a5473cb95b6535e3199b864d8914
BLAKE2b-256 ade0356e008c735105d45fc3410441245921bd787ae1496f7bb0104c272794a3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.16-cp313-cp313-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 840.9 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

Hashes for fraiseql_confiture-0.8.16-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8a26951e2ee77b1ab5ce714f831e27cadf75310d1158bd3ca9abe86b345f712d
MD5 99869c93faf5c83e15a0b4193c52b644
BLAKE2b-256 51852ec7db07caa2e9da6f53a26363c25b0eb252ed5639580ada3e404e09f6b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.16-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 795.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

Hashes for fraiseql_confiture-0.8.16-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c9a740b5e4908021f2dd9f92341024fbfd09c3d305e26049346542f66eeedd9b
MD5 bd0547cfd7f243cc93e9c2cc80400368
BLAKE2b-256 163fdb8aa213b598fff29d9afa2e6cfe3a9e63b6a7fcbc79d70202790da8ad37

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.16-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 749.1 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

Hashes for fraiseql_confiture-0.8.16-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8e4a289e840099d5d50a045b4fb79571b38dc3429cb1f8df8923a34f209f5ebe
MD5 7ea54acbdef83db2babe6d31b62e8b8b
BLAKE2b-256 4466cf1ffbf32fce36f31311953554fb809e22bc4b652b92682a84c95bde818a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.16-cp312-cp312-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 841.0 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

Hashes for fraiseql_confiture-0.8.16-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3877114f55ac6106e9205d2b10861a04e1e2b1dce5fbc81526f6c00f455108a0
MD5 61037eb2e9f454c753229566579b4c45
BLAKE2b-256 7d1c51a0c4c4d627b0d7974db07107ad3c17b7545ad2b4a0a6c8a665dc5b2422

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.16-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 794.9 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

Hashes for fraiseql_confiture-0.8.16-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c7d43d9439cc4c0b62f42bc32c435e01d210d84c97f79c3b42ea8c8f24777033
MD5 eeebfe1b76f0e1a318c001140dee4544
BLAKE2b-256 f4f330e42e2abf22b7506e2b3b663c694bb353ee978347930acb3400c59aac26

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.16-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 748.8 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

Hashes for fraiseql_confiture-0.8.16-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4dce6504f0c8e45c759282b9c333361d6114845204141c42b463f4ec206581e9
MD5 ecca9357d5c84bdb2daa742cf85f73de
BLAKE2b-256 514ad47325e5d8670e1348b4523fd49bcfa34dd4f724894b1f5f962ce25d2a2c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.16-cp311-cp311-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 842.4 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

Hashes for fraiseql_confiture-0.8.16-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 016f4b7805d972a2d6e1c213c9a9ae3497dd582caca60629662edb01176fe66c
MD5 05188544952e29e30d296527f927254e
BLAKE2b-256 e366dd0d5d3a0beb74dc5c0b6a1ec9596df18c8fd6a84a0a65378282d9b0d491

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.16-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 795.2 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

Hashes for fraiseql_confiture-0.8.16-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eb542b83521f45b7cbfcc3ba69447e61b8c434ae525c1377939fed96fb9f9a04
MD5 7fd0dbb033d3a45a39225b684274e764
BLAKE2b-256 807ce47335121d928ad1ef4c2d30f6f3c1a98e30faa563bdf4cc445e857c0146

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