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

Uploaded CPython 3.14Windows x86-64

fraiseql_confiture-0.9.2-cp313-cp313-win_amd64.whl (790.3 kB view details)

Uploaded CPython 3.13Windows x86-64

fraiseql_confiture-0.9.2-cp313-cp313-manylinux_2_28_x86_64.whl (883.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.9.2-cp313-cp313-macosx_11_0_arm64.whl (837.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fraiseql_confiture-0.9.2-cp312-cp312-win_amd64.whl (790.4 kB view details)

Uploaded CPython 3.12Windows x86-64

fraiseql_confiture-0.9.2-cp312-cp312-manylinux_2_28_x86_64.whl (883.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.9.2-cp312-cp312-macosx_11_0_arm64.whl (837.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fraiseql_confiture-0.9.2-cp311-cp311-win_amd64.whl (790.2 kB view details)

Uploaded CPython 3.11Windows x86-64

fraiseql_confiture-0.9.2-cp311-cp311-manylinux_2_28_x86_64.whl (884.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.9.2-cp311-cp311-macosx_11_0_arm64.whl (837.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.2.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.9.2.tar.gz
Algorithm Hash digest
SHA256 20f4568db29fbba5d85a866dabff1f13781a8ef1e74e160d4860ea3a2c1620c1
MD5 8b2613cd84e57514cdc44579be21dd24
BLAKE2b-256 115f5ec42c3051aa6595b676143b13cf2c916d6d3f2e17c5099cce0bb8efdbd6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.2-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 790.3 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.9.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 ddbd9bb1cf05a8e440b92f77f324a6d0ddf47c9c89636076e204c60a7bdd1117
MD5 3aae8597127c22573ec198e2a5291505
BLAKE2b-256 213679d75804aedb2ba9f75919a8a3af72421f9e634e2492180474478e70b804

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.2-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 790.3 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.9.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6a620090a1f27e21d2f52fc034eac06c0d64655450c0ae030f9c0d9098140bd8
MD5 c9a7b9f2682ea8689d287f4635e3e33e
BLAKE2b-256 b681722ae225f43ebb29212fa44533da05d030ee4d0d09f3c0a1aa7d76381030

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.2-cp313-cp313-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 883.0 kB
  • Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.9.2-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7d048e2dcdf0827eead5075f18feabfe81c65823a96ccc88edfeda2f8e789513
MD5 3b8071ecc655073ed22073326d6b4b86
BLAKE2b-256 997be7af7e150a0873d96473795cf0f9a9e9c8639b419d094b8b30beec773a3c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.2-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 837.5 kB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.9.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 457d15aa1f9c3e2639336ba6976f8e7b9f0095b17e6c10ea8e349dcc35ba2704
MD5 6bdb67d973885a2764d321814fb54938
BLAKE2b-256 e4f770434c3f574d59af758c04d1e6b5572cc5bee1a77f786d21e52ee6a7649c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 790.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.9.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e9f90ddf8a6378e5714c9ad0a44c5f0fae7be8b0ab9ca1e44efc9d5f4d994bd1
MD5 5a3264a816c26b53f3fd918ad1d410e4
BLAKE2b-256 34b8a0031987cb2086ba3bf0569092e89a22f59b034e78e4a4e695bfade80a86

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.2-cp312-cp312-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 883.2 kB
  • Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.9.2-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9b5ade063e3fc412ba066fe01ca11715f43f0c147a0a86a615c3dbcb62aeca4f
MD5 864fc0f3a3d52da44f83189cbbd2c7da
BLAKE2b-256 e59150316516cdf384e3ea2a925cda0a2723b39284a4697e7a4ac4ed08c45939

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.2-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 837.5 kB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.9.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bcaee039e908842d6e216393378170ec5db6d3219aa4e59756459058c78d06f9
MD5 80903137d05444d2bd261db3a52d60a0
BLAKE2b-256 e8773eaf41cc9e1a0d73bb8f1d302fff78a90c859415bcb9bba0b948d1946a7a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.2-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 790.2 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.9.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 32e1b9465910d80c7d37932a244eb497b23ac7be7750edeb8ed973f99260a5fc
MD5 7f456d64034dea662acf37b507a16f9c
BLAKE2b-256 1554747792728b46037ac539fad5a32a7ef2d3f5a196c33e2c1d96ddb6c965e6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.2-cp311-cp311-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 884.6 kB
  • Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.9.2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b6e5f03cd9fd45cdade8809d1d86b46715d8c843d4eff38d91a6ec9118b470de
MD5 ecf96410251806adbd4dc8ca29ee1d3e
BLAKE2b-256 75a8ff696ffff8dcb66d9d1ae3dbb788c920435bd6ceab355aebc9bb33a359c8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.2-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 837.8 kB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.9.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6c197f190c2067289641f4f8e8126e32843d17e13216b555a6574310e31e9909
MD5 5b09c69284ef342c26ad10e9c6d72867
BLAKE2b-256 829ea96f9f54cd01dbac461f5221702700d605975a7ad5d651580cdd022134ef

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