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

Uploaded CPython 3.14Windows x86-64

fraiseql_confiture-0.8.12-cp313-cp313-win_amd64.whl (740.9 kB view details)

Uploaded CPython 3.13Windows x86-64

fraiseql_confiture-0.8.12-cp313-cp313-manylinux_2_28_x86_64.whl (832.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.12-cp313-cp313-macosx_11_0_arm64.whl (786.8 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fraiseql_confiture-0.8.12-cp312-cp312-win_amd64.whl (740.9 kB view details)

Uploaded CPython 3.12Windows x86-64

fraiseql_confiture-0.8.12-cp312-cp312-manylinux_2_28_x86_64.whl (832.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.12-cp312-cp312-macosx_11_0_arm64.whl (786.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fraiseql_confiture-0.8.12-cp311-cp311-win_amd64.whl (740.6 kB view details)

Uploaded CPython 3.11Windows x86-64

fraiseql_confiture-0.8.12-cp311-cp311-manylinux_2_28_x86_64.whl (834.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.12-cp311-cp311-macosx_11_0_arm64.whl (787.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.12.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.12.tar.gz
Algorithm Hash digest
SHA256 50aa803519ad915361451efccad2a71c5420d8602e4a566b8aaf54e276903636
MD5 be8e2dcf13d80c0dfd2d95a8c8dbe561
BLAKE2b-256 837ddeb686a2660ba744cb2c5874f372f26286b082a8a59f78a520e432ad3e3d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.12-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 740.9 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.12-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 d2b94d1152f5a885a290afb1b7a30b66c4ffdf528f1da2d5d17149656f8b4b3d
MD5 d36713ce37777e458161eb88e9887f46
BLAKE2b-256 09b697d6ce02608a5c7d025e16c9654cde949780804c397e9db773ecf4bd6a44

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.12-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 740.9 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.12-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6b8ec292f4e181ffa962ab423e2b2fabdc8a0790a63d8fe077c24dcfec6cecf5
MD5 c7c5e0ae768240b2bf1441a20ce20245
BLAKE2b-256 cc557283b0458f89b3dc12beabe5d53d946e30cd5dd7cfb03126759c1f6b45a0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.12-cp313-cp313-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 832.7 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.12-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7384e6f4e0137122f214f8fcbefb3526c5042b81abc063392441b312978a908e
MD5 a5bb1517b30dab7c8f13737c132454c0
BLAKE2b-256 f912b58e19eda8762c5cd4ab94dd23ddb6ac14a7f6814a6d8fe856c8635ff75b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.12-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 786.8 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.12-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0b9c95954e994b1db124bd95ce173eabb4d55cfdf3f0001231914c4aa7f97be8
MD5 0e4001ce197712a408aa9f9d8203bfb6
BLAKE2b-256 d02432efdae876bbb5f1ef627cb6e5301310bd267a9dc3bc8ee7b1b024cbcede

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.12-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 740.9 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.12-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 eeab2a176ef269d9c389ae63e15d73b0ecb85e1b70e429a4540bdc52333f4b17
MD5 30a9b4fcffaba1c50d8132c0c50ebd0b
BLAKE2b-256 74ec96af186e5b9753b47762c5b4b17527aaf3efe21c96a40168c068f711d980

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.12-cp312-cp312-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 832.8 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.12-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1a113296df3ccaa973fe2b95f79e5db49e3bb115cba7931e3ee131563ad4620a
MD5 e5f2825915f82dfb48a5d559e062b067
BLAKE2b-256 ad7f644fa6ad5309e1f71bc14fc2d8ea4660b338289a6b4a38d969ecb4be2084

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.12-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 786.7 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.12-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 815607cf28a0a695931fb06e76463928c07efce7a3458e581cc30df778d9d30f
MD5 98110cc95534f53351e2ff1eb7b016d4
BLAKE2b-256 702117ad829711281e44490592179ad35417511a368b9a3d15b87afa504c2f55

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.12-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 740.6 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.12-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2671c5f3d16daeb5a2aa18a15071cb80d86fc46012a8349b4dcf82a57dc1c1e7
MD5 c8e2232b013e9797ebc2a26d13a5e235
BLAKE2b-256 e09fe75bc8026d5eb3d9a0b858ac0dc1b24846f2e30bdf6a54b5ec20fe9f61ed

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.12-cp311-cp311-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 834.2 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.12-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cf1ac2f31e7acea8506186823aca3c43038a01c0ef6cab4007d6332e72f2f981
MD5 a35d29a233b5ed8d9f5d734107ad679f
BLAKE2b-256 20bc07d2fb389e626ea6228a6d81c8369dc07560d09dc57c717b70642c5b457a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.12-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 787.0 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.12-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8694ddb524584b07ff3c32db8d115994e9fe528306a53631847bdeba45445844
MD5 3911f8f6ac4ced393110a2db3e57a248
BLAKE2b-256 09804e4b68a55a4398cc8cbecdf1ed1e8efe6ba1c636d61ba33ed38fd633e341

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