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

Uploaded CPython 3.14Windows x86-64

fraiseql_confiture-0.8.11-cp313-cp313-win_amd64.whl (740.8 kB view details)

Uploaded CPython 3.13Windows x86-64

fraiseql_confiture-0.8.11-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.11-cp313-cp313-macosx_11_0_arm64.whl (786.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fraiseql_confiture-0.8.11-cp312-cp312-win_amd64.whl (740.8 kB view details)

Uploaded CPython 3.12Windows x86-64

fraiseql_confiture-0.8.11-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.11-cp312-cp312-macosx_11_0_arm64.whl (786.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fraiseql_confiture-0.8.11-cp311-cp311-win_amd64.whl (740.5 kB view details)

Uploaded CPython 3.11Windows x86-64

fraiseql_confiture-0.8.11-cp311-cp311-manylinux_2_28_x86_64.whl (834.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.11-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.11.tar.gz.

File metadata

  • Download URL: fraiseql_confiture-0.8.11.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","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.11.tar.gz
Algorithm Hash digest
SHA256 4c445c01e1b709ca7e6cc531e68f2089f846f49635a02127d63faf8383e465ab
MD5 71170b2f6de0b4a5a570326ffa632167
BLAKE2b-256 942c30315c4096740fca3cece86d6bdc75f51723667a1a768da9d1d4c673c82b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.11-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 740.8 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","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.11-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 545320a90a558e1b72a6d8ae84f692c123fe2ed90cd98983574017759bc0c32f
MD5 bd65dc1d167a7b30b9f543ed999e8b87
BLAKE2b-256 436b68c2831366b2a230193f1eda4ad03acad0dbe5c9dd7d94f3a0b3f2a19346

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.11-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 740.8 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","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.11-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6437fc2f0af1503643b264625c8905a30dc9b71cbdefe77b6e6b0cf366e165fe
MD5 4139640661407e85c718fa94bc6fef5f
BLAKE2b-256 217f201376d2dd281ff8eaa7156c8b96eb2f43db53c7ab61d09ab7a5ab4178d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.11-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.0 {"installer":{"name":"uv","version":"0.11.0","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.11-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 795806482787bf9560995341429af053054c70e5bc43c7051b37d74c41a08658
MD5 edc88f3bfc5bd2db394d975af9cc59e0
BLAKE2b-256 229af6c95a231b90744f3224e15940b3e14c9efb4e35e033aef85f427930d49d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.11-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 786.7 kB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","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.11-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ba54b0e7c55c30dbbbee1ea3ce6947acf815ac16aaa30a351f43451e68a924ec
MD5 971c0066754ccd7b33f417af780aeeea
BLAKE2b-256 91a54387766ad815cfd291ef89e312bce06f4250526ab850814c7e83dcb280be

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.11-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 740.8 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","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.11-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 129245fcea4bcba9bd607aa750e13c603d4744eea0d6609b5b4b8ebc4c591a72
MD5 f79f8093e8765d717127f5dfd2b0d15d
BLAKE2b-256 9c305085c8ebd035b918a6be2ae3ca77e08c422caec28f4d1611ac3dcdbd49e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.11-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.0 {"installer":{"name":"uv","version":"0.11.0","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.11-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c7ee38ddc6907486916c15ae8f3f23fa53bd3248c1ea984e2e054c86ea190d89
MD5 d5ddb20be95933169994276d44156929
BLAKE2b-256 0676348939e39a6b54291568f52b943c275fb76e137b67235efd847c39dcb215

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.11-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.0 {"installer":{"name":"uv","version":"0.11.0","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.11-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 268daf61b586507989701a09704d04973c047704f030110db6d9067d91e627fa
MD5 125d0becbf079d5c5dac6963e2093d27
BLAKE2b-256 318877a46592d63bf7736d686f34cfbaf445bf5cea9e92be0cea5cf0176141d7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.11-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 740.5 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","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.11-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4bbda00186e361e379578f6dd21ed9159b82298e465b4776d9dabc439aa49845
MD5 a663292f52ac366d547d7253169af32c
BLAKE2b-256 7521a8cce5250a839612ac11ae111244f528bbf494a2c32022772a3aecc9cdc2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.11-cp311-cp311-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 834.3 kB
  • Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","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.11-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ac4ea7418e63931a54f6cf117b5aa7af903eb91b9c1e125ee58c19802850c1bc
MD5 ecb5fa3ce95b5be59f28a3a4d42028bc
BLAKE2b-256 462a88d826c21ae662c81e8d40bc39d2b7b671fcdc2deca1c39a258fb0594c07

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.11-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.0 {"installer":{"name":"uv","version":"0.11.0","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.11-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b5a0f4e6639b5be2d8911ef000b6e239444c51e032281b4fb79df453c6a126ac
MD5 680e5cb2a88fea126c1315e5d827978e
BLAKE2b-256 8f8e64c5e60652e9a97c8a6cbd8d07fab42eeb82077ee102984ae7b69e4700d0

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