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.5.tar.gz (1.6 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.5-cp314-cp314-win_amd64.whl (797.8 kB view details)

Uploaded CPython 3.14Windows x86-64

fraiseql_confiture-0.9.5-cp313-cp313-win_amd64.whl (797.8 kB view details)

Uploaded CPython 3.13Windows x86-64

fraiseql_confiture-0.9.5-cp313-cp313-manylinux_2_28_x86_64.whl (890.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.9.5-cp313-cp313-macosx_11_0_arm64.whl (845.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fraiseql_confiture-0.9.5-cp312-cp312-win_amd64.whl (797.9 kB view details)

Uploaded CPython 3.12Windows x86-64

fraiseql_confiture-0.9.5-cp312-cp312-manylinux_2_28_x86_64.whl (890.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.9.5-cp312-cp312-macosx_11_0_arm64.whl (845.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fraiseql_confiture-0.9.5-cp311-cp311-win_amd64.whl (797.7 kB view details)

Uploaded CPython 3.11Windows x86-64

fraiseql_confiture-0.9.5-cp311-cp311-manylinux_2_28_x86_64.whl (892.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.9.5-cp311-cp311-macosx_11_0_arm64.whl (845.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.5.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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.5.tar.gz
Algorithm Hash digest
SHA256 11cb8271cc6689f798c5a10e0bb1d8197eb67454f411fa15e1c04eadd6edfc98
MD5 cbff401c6bfe215496765f86ca7e63bf
BLAKE2b-256 e7cb146686ba49d90eba977968a39b1c0d88ca41bf707158eecfe2a760bd4d88

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.5-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 797.8 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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.5-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 50fdf10fe6c3c166f67e47d9ff16cee863366ea1d9fc0889a07571c68bffb6b0
MD5 7711e0918f29cc8f81b375686a40b847
BLAKE2b-256 a13353ba2ad73a31be868511aeb8f1d17b50b017be30057ff7613ee4325e99a0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 797.8 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7f3debd22c3acc85cba6ff934cdd151ec5da3b664c67d43d4e7e84816142c8c2
MD5 37203cccd1edde05b31132e21a1a27ed
BLAKE2b-256 3a630e1c813a7dd389f65d0bdef13cfaba215a308d24e4b98fa0b6449a6e7576

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.5-cp313-cp313-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 890.6 kB
  • Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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.5-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 977aded0bd1733042d7c9ea96ff9ea14cda695fd141a231c0c6a5b069c6e191e
MD5 ec63ffbb4a6025b853a267a662f13332
BLAKE2b-256 87eeb8333feb6109798c9c4cd625b5facea2ec364a918b827cfd782801ff3d10

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.5-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 845.1 kB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 faa29b646836443de830396c0bf692678725d68645332bd97fefc29a5bdcea1f
MD5 c39860e87f3d4ea006381e185f01cb00
BLAKE2b-256 1364336d415777fdb2219965d856cb83aefa50d012f95b852c3d085dc704dd20

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 797.9 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ae3fde02fb35ac327c1e2d8dfb9ff750274acf547db087af927ab2b8a0abdd09
MD5 9d4f11c37f15a242012beaeb8a4babea
BLAKE2b-256 c6187b4f6941c71e23184f50dc802878587e6108166dbf77afa1187ed2a44262

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.5-cp312-cp312-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 890.7 kB
  • Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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.5-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0d06e9eff49cba2309e2b30877b0a15634d4f2865d28a57a02b4c139d187a4fc
MD5 52fe09ec18eaff98218f2fc2a1952e96
BLAKE2b-256 9590ccc66189abcc47bb214111486d6d87b6415f4457369117063ceec1ff06d2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.5-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 845.0 kB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 67be28c191d4884d379823ff9f40f7ccc8f7c59e7864622a1664686d33b2f9a0
MD5 ebc912a748e3b596aae3f06b860e1627
BLAKE2b-256 a61a1432889b4a07c8c822dd723bf8ac5634f50076f27a804af5428df9bc1db5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 797.7 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c86e567795fb71e11a2f84290a7d974cd5fd62b6512c5d290b79e227f944faa9
MD5 9a761b1d0a22f1bd5d2149d150aa0efe
BLAKE2b-256 47428644ea1861ae8e210312a0ece1ed7f1d8b590ed0508b0a760eaea081e57d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.5-cp311-cp311-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 892.2 kB
  • Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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.5-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d5be83184d42effd605db6c41d54fc541135731024a5f2e04760c153574b9138
MD5 d5a3e167d54eb365451a818ec85bccc4
BLAKE2b-256 b3951ddfde97270321e7561ec3016924bbe1fb8f69d0157c3ee40c7695bb15a0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.9.5-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 845.4 kB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dd6bc05df2eeeca78ca542e182bda35c414ed9d25287d8fb8de2e8062bb0becb
MD5 394ead40e57c99e3c3706b5d7510ee62
BLAKE2b-256 a20e9d8d5e157c7062b490c099ac1d3b68e140fa60d68be3ca45d6da31586098

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