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

Uploaded CPython 3.14Windows x86-64

fraiseql_confiture-0.8.22-cp313-cp313-win_amd64.whl (769.8 kB view details)

Uploaded CPython 3.13Windows x86-64

fraiseql_confiture-0.8.22-cp313-cp313-manylinux_2_28_x86_64.whl (861.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.22-cp313-cp313-macosx_11_0_arm64.whl (815.4 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fraiseql_confiture-0.8.22-cp312-cp312-win_amd64.whl (769.8 kB view details)

Uploaded CPython 3.12Windows x86-64

fraiseql_confiture-0.8.22-cp312-cp312-manylinux_2_28_x86_64.whl (861.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.22-cp312-cp312-macosx_11_0_arm64.whl (815.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fraiseql_confiture-0.8.22-cp311-cp311-win_amd64.whl (769.6 kB view details)

Uploaded CPython 3.11Windows x86-64

fraiseql_confiture-0.8.22-cp311-cp311-manylinux_2_28_x86_64.whl (863.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.22-cp311-cp311-macosx_11_0_arm64.whl (815.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.22.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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.22.tar.gz
Algorithm Hash digest
SHA256 9bc9495ada33fae608b1de50ec772f7efa276f8e96d138da9628ec2e6a2d1661
MD5 3086dfdd49fa2d64f00448de7726b5b5
BLAKE2b-256 709e576e6d3901cd55b151f839a74cae7f6a2e51820347b998b1fefd5a1f6f42

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.22-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 769.8 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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.22-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 2a6dae21297baeded27b13502419af7e8af3052b0f1e6b60ee6a057bd5f46098
MD5 93ffabc40962d1a07fdfbc29ec64e765
BLAKE2b-256 9be9ffeab00d8072094b54d43035e2df6b12478bc3fadf810f6edceba0574adf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.22-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 769.8 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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.22-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d586bfa74eb045bb537cc96f623244412dd3e9227b26de56d9792458e3f86bf1
MD5 a4790d718e823d8059620dcd68099d01
BLAKE2b-256 6a40bb9b6a359db69983b4bde3a2197907973769b2c569405250f9672df87b9f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.22-cp313-cp313-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 861.8 kB
  • Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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.22-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 afafe84c37e6ab9fe1ce7f7f2c5313a3e414dedd5a4b992549d8c019ed8ffe5b
MD5 a6a9c965317b556b031b7056f43fbe84
BLAKE2b-256 1575f86abbb05f96b0be6c88aa0d49d365d0964c6d7ddc6b3fe3f51e06d92d06

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.22-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 815.4 kB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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.22-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cd89c554f191b53cf20ba033c57b1abfc0eeee1908304bcf1f5e1fda1a7f8099
MD5 377b7822d75eb8c1212c9935f5ce1213
BLAKE2b-256 51cb9fb49bd06b078df4e057827109fb9e56235d82ad90bb020fe31b15d3dfb9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.22-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 769.8 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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.22-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f23b278b59f6dbb6018ba54d13f67fa1c607473ed70f267777b0ca36eccb23db
MD5 074a9c2ef1bc9f4d6c76ded2b4231814
BLAKE2b-256 41af041a445837dc00380784f8ac1db5e1260a29a236fa11e1bede065a125856

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.22-cp312-cp312-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 861.9 kB
  • Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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.22-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 670e09511a0f02593e0df8678c517a50661559774cec63a992bbe82ddc5b12f7
MD5 aa68ae1d77825d2c26e3770b65f333aa
BLAKE2b-256 d14bba1624196b1d083abe26a18b6e6454dc463f35984ed13d509f67fca4f11a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.22-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 815.4 kB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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.22-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2d7450b04f0284aeabb998f28f84e5edc6bd8871a25a39f8ecbbe78b8ac9e15e
MD5 fd222bed4038be6958a8eb73f9b38e01
BLAKE2b-256 2409db70ed8f01594738260b0e4bacbe0338857f6dd691d4f2a13a632fff8acb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.22-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 769.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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.22-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8cd69886eee26a6d8cc691816fe868e7f92ed059a7f56183849ad8f73dfdf2c5
MD5 52035582d5eb86776922c26933ebd85a
BLAKE2b-256 2dfd502a8757b3c59b36bfaa39ad0dc7313ecfc326080a597ea22a6b3acc2678

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.22-cp311-cp311-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 863.3 kB
  • Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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.22-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3207d512eacebc1ae84ce6caafe2c36fdf715ed97f5e3d3bac3511a37be5afb9
MD5 a784cb5827d63ce42a5c9d2335066b5e
BLAKE2b-256 0d6d826ae52a5a30863c861092d838f68cfddf7c381679ed3652fef56f977993

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.22-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 815.7 kB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","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.22-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 49c8b48e64fd93d5ccb56ebbf919dcf77716d1247e2cc012c9361f68e8556a02
MD5 de534894697b3c126938f2e8c0185f6b
BLAKE2b-256 a5fa1bb2e8183adf44540b15ddfdb1f70c73f2c5843d6015c2555e46a669f092

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