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

Uploaded CPython 3.14Windows x86-64

fraiseql_confiture-0.8.19-cp313-cp313-win_amd64.whl (750.4 kB view details)

Uploaded CPython 3.13Windows x86-64

fraiseql_confiture-0.8.19-cp313-cp313-manylinux_2_28_x86_64.whl (842.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.19-cp313-cp313-macosx_11_0_arm64.whl (796.3 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fraiseql_confiture-0.8.19-cp312-cp312-win_amd64.whl (750.4 kB view details)

Uploaded CPython 3.12Windows x86-64

fraiseql_confiture-0.8.19-cp312-cp312-manylinux_2_28_x86_64.whl (842.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.19-cp312-cp312-macosx_11_0_arm64.whl (796.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fraiseql_confiture-0.8.19-cp311-cp311-win_amd64.whl (750.1 kB view details)

Uploaded CPython 3.11Windows x86-64

fraiseql_confiture-0.8.19-cp311-cp311-manylinux_2_28_x86_64.whl (843.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.19-cp311-cp311-macosx_11_0_arm64.whl (796.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.19.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.19.tar.gz
Algorithm Hash digest
SHA256 4bf6618be0cb089e62e651c2bd5ba9ddd18f1998edc7d87ab626e5a4eaccad69
MD5 a3dcfe9bd60d2d1b4d6d72ada8270184
BLAKE2b-256 42415e5e0ce2e4559f7171c06c95bb3dab496e352c6e423e2a2550c0462c226c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.19-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 750.4 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.19-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 1f6854a39efd46dd1cef1d3f3ff3e64b817ba16eff8d81b425d346f4bfef8595
MD5 05a77603c656d5be00cf7f28c80a1c5d
BLAKE2b-256 3ad0494f624b92f1877ad3c7a374fd22c57b03eadf35a47d9804f5a37e6a13ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.19-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 750.4 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.19-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 5c8b9484ceb0e3265adecb605cc0af757884c5e1014b0b2ab23fd5d581cfe6e5
MD5 0fa7d4561cc7da975449166514280cff
BLAKE2b-256 7197e85e312f6cf165303c5ff4d401b0653b1f61a68074e1102c5971247a4467

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.19-cp313-cp313-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 842.2 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.19-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 244133049a84d884e27ceebf846487ada6a4b128c04e145923c590df017c3d03
MD5 cb0a5a0382981707e297c163bef5d2a5
BLAKE2b-256 6152c98239d9973de99e68f3648279da7afead8593d7a5367d656b3e7bdb26ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.19-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 796.3 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.19-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fb86233c2895d7c567add37273353309cacc97c255f8fe0a5b1d5fc48409de85
MD5 838fb80364f43c0f050fd68c1c0a704a
BLAKE2b-256 0db0fce75a4461638ab7b4fd683354776d76a10ae680db9f7340a88d812f4aca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.19-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 750.4 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.19-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 12aa8b11ebf84c7f1ea41761492ca4e617cc1b5776476b2c0e553b53fc3c0f0c
MD5 461a095fbe2b869601a08427e15fb484
BLAKE2b-256 8cdfa626408d681c5881912f4028945d7aa66cd0cca121bc629e23f3348a1a00

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.19-cp312-cp312-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 842.3 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.19-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 66c7bc3d13afa877fe653aa9448f3bf5a4b481dcd655b088331a2f51028e61d3
MD5 dac291ab6af441b6a75dc1351ed53167
BLAKE2b-256 19665d57fdaf8976c30f7a258a2397632dd86fcd3fc95c7e6e4c5f5ddb5f3552

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.19-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 796.3 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.19-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bda3f3257e5e1f485512aca8c74c50ee15559ef70043130d4519350be0a93076
MD5 6e357aaf0708399305e02091e5e36552
BLAKE2b-256 863e7f4b9b8c4905e112363ad6135d3033a128b8b4eb49cc51f0b3027acc2948

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.19-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 750.1 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.19-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7a2b1be4618d2237a069111c00bb61dabe0140004e62f238c1eb08cf4e8fe9ce
MD5 64d4b1e64b90c75457a18da3f62e5571
BLAKE2b-256 83e62799d47cb6f298af3e4d34f3b44663b8b642409ad2ed1e245d9a605aa3f1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.19-cp311-cp311-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 843.8 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.19-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 55f812392d049bbf5e650a6f7c009ff2423a65c950f82779385c44e8ada9c77c
MD5 6f7dcc76f9746641464f62c580f2a9e9
BLAKE2b-256 318c4ef0c3463b0eca0455c4ebb262aedb82aa4216bda4b2230b6e7fb1e0bc91

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.19-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 796.6 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.19-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 899b655fa0db79b68e88c0bf70a0a6e32a2bbd19e2f7d552301d35b0e66cb42e
MD5 e8381a9f28cfed1dc0b6a28fc2465ed8
BLAKE2b-256 f4a53a4c885560d27dddf5109f77cbb0dd8f80c1d2227b25cc92a259b2c4bc6c

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