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

Uploaded CPython 3.14Windows x86-64

fraiseql_confiture-0.8.18-cp313-cp313-win_amd64.whl (750.3 kB view details)

Uploaded CPython 3.13Windows x86-64

fraiseql_confiture-0.8.18-cp313-cp313-manylinux_2_28_x86_64.whl (842.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.18-cp313-cp313-macosx_11_0_arm64.whl (796.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fraiseql_confiture-0.8.18-cp312-cp312-win_amd64.whl (750.2 kB view details)

Uploaded CPython 3.12Windows x86-64

fraiseql_confiture-0.8.18-cp312-cp312-manylinux_2_28_x86_64.whl (842.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.18-cp312-cp312-macosx_11_0_arm64.whl (796.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fraiseql_confiture-0.8.18-cp311-cp311-win_amd64.whl (750.0 kB view details)

Uploaded CPython 3.11Windows x86-64

fraiseql_confiture-0.8.18-cp311-cp311-manylinux_2_28_x86_64.whl (843.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.18-cp311-cp311-macosx_11_0_arm64.whl (796.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.18.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.18.tar.gz
Algorithm Hash digest
SHA256 1dcc4d7233a58445bdeadb048dfbec4aed0b3caabe329a2ec1fd5ef7416267e3
MD5 bc8bc1beae71dd0d33d0d254852d3e97
BLAKE2b-256 51d2abad6dd915247fe99f7693e6f373efe614ade11cc89dda08ec9cb29890de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.18-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 750.2 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.18-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 44c148d65ee854c0030921e7bea89389d0e9ef8d42a5e0357a126b50ff0570f6
MD5 b5ef1372708bd24ff1323a88270dd3f6
BLAKE2b-256 9224994d8d3492adf1f8dad2c27ea24f0c125d73de680acfa942276ebf5addab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.18-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 750.3 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.18-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6a293954e73e960f3b810b636992caa035eb312bb54c9f751f1ea758db529cf3
MD5 967d1d8c63421bc12cccc779b719706b
BLAKE2b-256 f089d621a8d60ce54beddf5efe4c17a456fe525523cf9df78c6211ca3459c5b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.18-cp313-cp313-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 842.0 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.18-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0a91fe28d583cc61aaf4d0a30a9d32b75ce70d6351c8fdf3ccb53dcadb229e3a
MD5 65593e5b05dc1e725ee4156ec3a04c42
BLAKE2b-256 3067dc5b3836c0ee6018ffddd334900562c30a740d3af2de732b3d6f76fe4ef5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.18-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 796.1 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.18-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0755d5c7b94004680c30ad85cc66e13a99cab6d9101033e4b0ee4102f996f496
MD5 982dc04f811c3af3c0f2b33e5bd69f7e
BLAKE2b-256 5d319a7882af62b274cab4718bacc80e44ef81640436d2f3fe6f5ba0b4082e25

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.18-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 750.2 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.18-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 93ddd5058c3786d0b33b8a6630d35e6513c5e59b3e37f3f556b288696014e3a6
MD5 0d980d998b816c4281aee5c73e35f0f1
BLAKE2b-256 24000762947e1a5ac56518e7cdf00f9d63defee558fe4029938fbe7825cc1c45

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.18-cp312-cp312-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 842.2 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.18-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c5bee8388cdf03692388fb8ce7611e2a396913f879c4e8ef1132e9b1b76e456c
MD5 fb8ddb0c15575d68bdbc3cdadba0cd17
BLAKE2b-256 86cf1390108c0f47dd9f35f95e4051bc474175011b7278be9466fb2e61c8f503

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.18-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 796.1 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.18-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6278a2fb3a303c25bbcd17c66c59b20df5a62dc62e4fe37e1f496a3e7661f45b
MD5 a4bdab7d5f47784d245e510125db5219
BLAKE2b-256 6340aa28ddb17d669c6ba5ae57cb6d72008f42dfb5404522381c3756e84c4dc1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.18-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 750.0 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.18-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5c3e735a28bd002f576db6273a71ea70f1463a22e904359e297c822a8306844d
MD5 c7f336f667919742954c4d3be9471904
BLAKE2b-256 652636ec402e03c2b9a649ec67f243df63f096b4a85dc0ee74db8c48dba85323

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.18-cp311-cp311-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 843.6 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.18-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 422d9c7b8ac8558ade1775dca1bcdbd1a656ebfdc50bd1b12f29e613d4017f4f
MD5 e47029ee0ca2aa64eb8ae633a21cf555
BLAKE2b-256 01b5f2e522155849a8a1ec8e0e412079154f1e2fbb165d4f638776c4e6d01215

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.18-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 796.4 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.18-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0e89321aa12cb83012f51fa14c495a1f688b7a6dc2bb5bb024945e31b5f987c9
MD5 af9231d1a9201f838e35813285b7228c
BLAKE2b-256 43d371c4a1dcd35a823c3604e54c4c959fa60eaa525ffef46ab64df1c2d6d3fc

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