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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.13Windows x86-64

fraiseql_confiture-0.8.13-cp313-cp313-manylinux_2_28_x86_64.whl (832.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

fraiseql_confiture-0.8.13-cp312-cp312-manylinux_2_28_x86_64.whl (832.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.13-cp312-cp312-macosx_11_0_arm64.whl (786.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

fraiseql_confiture-0.8.13-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.13-cp311-cp311-macosx_11_0_arm64.whl (787.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.13.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.13.tar.gz
Algorithm Hash digest
SHA256 652dcfe63b1a80389a25fbc328f21bc8213b90f41a71b16735470dd389a1dc90
MD5 f388c06c0f600dbc788474534ec199af
BLAKE2b-256 ee9bf321884cf0f7f435960e81e5cfcee177b5c786e678e4e3b8894bd2b36a28

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.13-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.13-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 e938c22d139c5aad492c0d952de6e9456529aca431716554fc30dbcaee23fa79
MD5 0fc200f5a3848fc1abe3a423b57200cb
BLAKE2b-256 7468dfcd15359e506878b9ddba542bfe63a6fed8243bef8e3c7c87c8c964539f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.13-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.13-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 67844e51d3a3c5dea09947c6781b0d570d4308130dad7f364be2e9efc0635f5b
MD5 505e6dd4c14f8046b593d54d70f08671
BLAKE2b-256 25e0df77dafe561f55fcd656a030e3cfa05e13b949950258ce9f1ae3643ad278

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.13-cp313-cp313-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 832.8 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.13-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e65b7ebe53e180277b72e94a3a56c84033e43bf3c04e818b6eebdd736fa7c12d
MD5 06833276391f45699e1e940b71e9c5cc
BLAKE2b-256 438b9e434c7b85bb3a1b36b012cd3bbb0ace2c999a9f6214f80a3e28cba7c7a7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.13-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.13-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ee10e11388990f1d2356f4ec05ae21bd5d60333f3308e6dfa5dae6fe66c33d99
MD5 44787ded411460e0a79ac556638533b3
BLAKE2b-256 2b6735816a89061f3733168e658d76857a60745afdf91c8635a8a6397a571dab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.13-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.13-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bf98ec3eeba3e6591a156b928a2a5a5d1d2bc9596ec8e67069ce8a894e26c1eb
MD5 ba26ae74708d1a4c6abeb92a00460f4a
BLAKE2b-256 901b4e839faea88c4c5e0700003a1a1592775eda0a7e7e1cdb405e8bd9bc7939

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.13-cp312-cp312-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 832.9 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.13-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b44d5623cdecd5502f922ee6e926da66f0d3b4ce727fc9a845a175329a60e5f4
MD5 862d843dc31d7803418c5896890cd44a
BLAKE2b-256 ba3dd32d0b41df93917eab8297cc820cd2ea3c5c45e8a813978ded547f9cc924

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.13-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 786.8 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.13-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cf35916cb6029f3e8cc52f50e02df9d9d10de986ab1f27cef04d81700f7d43f5
MD5 91fd55754e9364b0caa7a0aaa8ffb0b2
BLAKE2b-256 444cd2dea73edee5157ae6e82e6d6dbf87a58560d54dcb244870b410f387364e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.13-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.13-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e6781fd72c77ccdf96f4c1b4ed64a6f1eb49b1ca0fcaf3ecb57c5f8d2b3503e0
MD5 4c3b09977d25e71f4d4370443188a58b
BLAKE2b-256 8d7dd92464027c21042935c70ae6512b804b8dcbc8db4fa283cf15b8b9101c1b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.13-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.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.13-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e8af713d909226192619c8010a649faac2168a9048604386926b4d70c0e985e4
MD5 88a661bf444e729cbcd529477b0e0a83
BLAKE2b-256 1830fc69e8d785f11924a416c216a9bbe91e56094c262cd2f5a113adaa319177

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.13-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 787.1 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.13-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ee6794b03c660962ba6ad5fdde987bdd5dc01693eb1a0469032d8e98048bed95
MD5 8634fc7c4dd0b482dab28b71c2b53bcd
BLAKE2b-256 060eb493778939805d5fbe9b90a106e181b69403d84801348960f3051ffabc09

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