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

Uploaded CPython 3.14Windows x86-64

fraiseql_confiture-0.9.3-cp313-cp313-win_amd64.whl (790.5 kB view details)

Uploaded CPython 3.13Windows x86-64

fraiseql_confiture-0.9.3-cp313-cp313-manylinux_2_28_x86_64.whl (883.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.9.3-cp313-cp313-macosx_11_0_arm64.whl (837.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fraiseql_confiture-0.9.3-cp312-cp312-win_amd64.whl (790.5 kB view details)

Uploaded CPython 3.12Windows x86-64

fraiseql_confiture-0.9.3-cp312-cp312-manylinux_2_28_x86_64.whl (883.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.9.3-cp312-cp312-macosx_11_0_arm64.whl (837.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fraiseql_confiture-0.9.3-cp311-cp311-win_amd64.whl (790.3 kB view details)

Uploaded CPython 3.11Windows x86-64

fraiseql_confiture-0.9.3-cp311-cp311-manylinux_2_28_x86_64.whl (884.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.9.3-cp311-cp311-macosx_11_0_arm64.whl (838.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.3.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.3.tar.gz
Algorithm Hash digest
SHA256 ee436f27e456489f77f6f70d6d104e8ec062ca6fb733b3852e32f663959c921c
MD5 ed82cf20d4ba119a1e84586f228448d6
BLAKE2b-256 ffb7d0eb6781ae7cf6a9a925a87f8c1132f71940a034a5ea24cc4e4e39b49797

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.3-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 790.5 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.3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 da2041868820d10e57ef897b4fac493b7a133541bdc0b0a7d917b3aabd78d072
MD5 d8174377140eb3ec22c1463628ec7ae8
BLAKE2b-256 416272a291602a639403c7ccd2b71dac4ebf8f715e31262b0b293efec506e066

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 790.5 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.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 dc875b8a9ce119d413d23f0538f43d612ab3f4b3256d65c2f72a61fb389a4420
MD5 ee18165d0f3d2f5289a279ebaa327f31
BLAKE2b-256 87bdb7c0695d610fdc2c411cfe3be9bdc74fb9320788c3692c7084a29dfc50a4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.3-cp313-cp313-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 883.2 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.3-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cfcf8ace74d1d6062a48c4d10ee1727862ff82669939de0aafa95281be775f24
MD5 9c4da25e179af42d0af60c01da2cdbd0
BLAKE2b-256 b3496d15ad40cfc3016bdb48669b3124c9a790d3893c5732ec3c756099ee3cfd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.3-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 837.7 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.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e8edc725f22443878c8a9588ec2b15faf7133adabaad9d47b0723dc32b168b71
MD5 b4a1e912511f156517541d2b0e9f9f97
BLAKE2b-256 dad9323fe66dba2e10191df7b023704ed9c3c00ab3d558cd71f27790f20bc735

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 790.5 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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 65ba02f38a5da6cb473d37a8c52c6a5a88b8c414ff0089aeaa17cfc226d89abc
MD5 a342a48d9b3e8cc69395a9e180123937
BLAKE2b-256 80cbf398998dab3fdc8388673da093e7a0d4f83ecd7238b2c9ff9f9b2e8483bb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.3-cp312-cp312-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 883.3 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.3-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 380e3aff47f21ba8837c0b5d1aabf68ade0f706ae74b40d84594aa137ddebe11
MD5 9e89c41003925b2d00390e5876a4dda3
BLAKE2b-256 439e0e28441d06187ebe97f0e5c0130d695bf8c17546adf96e10d178080cebfb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.3-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 837.7 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.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1c691d725a1cf2fb2957efc38af135bc2c5d8023b50119bd4ea390e413ea3712
MD5 5cae52cc83126e04c858e25952847ae1
BLAKE2b-256 5187e62a1028ee8390df38834f171ff25ba2a557fa99c6b54a86c4a35dde7163

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 790.3 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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a69a14628ff57c0a968824d085755d940a01b1b11edf8268f870a24f85b87452
MD5 29daa9169eab16a9b5bffbd1a37cba2a
BLAKE2b-256 13aaaa207a5d339a37d5ce3670cd1e419a8cb7cd3eae7e5e8b04776a7df557b4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.3-cp311-cp311-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 884.8 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.3-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 66e85624c8049cc5f09a3453caae9c984f84e86a98ae980cefe972b26980549f
MD5 daf4a4523f19e1106e3d66366799797e
BLAKE2b-256 3ea2f58d1a8dbec14365a1d7aaa22b4fbb2978d8f343c00ee47b9083c793e038

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.3-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 838.0 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.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6be7e52c3388da64969cbc4f8285c74eae13fd86759e8db3ae3fb12b6995e4ce
MD5 a63c169c93b56b6fe47a4599405da594
BLAKE2b-256 64ed68af96cc77d01859dfde49429eea3e45ef0c151c2ae1d67dab1c8ca9673a

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