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

Uploaded CPython 3.14Windows x86-64

fraiseql_confiture-0.8.15-cp313-cp313-win_amd64.whl (749.1 kB view details)

Uploaded CPython 3.13Windows x86-64

fraiseql_confiture-0.8.15-cp313-cp313-manylinux_2_28_x86_64.whl (840.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.15-cp313-cp313-macosx_11_0_arm64.whl (795.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

fraiseql_confiture-0.8.15-cp312-cp312-win_amd64.whl (749.1 kB view details)

Uploaded CPython 3.12Windows x86-64

fraiseql_confiture-0.8.15-cp312-cp312-manylinux_2_28_x86_64.whl (841.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.15-cp312-cp312-macosx_11_0_arm64.whl (795.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

fraiseql_confiture-0.8.15-cp311-cp311-win_amd64.whl (748.8 kB view details)

Uploaded CPython 3.11Windows x86-64

fraiseql_confiture-0.8.15-cp311-cp311-manylinux_2_28_x86_64.whl (842.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

fraiseql_confiture-0.8.15-cp311-cp311-macosx_11_0_arm64.whl (795.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.15.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.15.tar.gz
Algorithm Hash digest
SHA256 64b47b61c9dbeea03fc8c2f0e60b9f8f673d1b7756e46a50bb60fbcaf68a5409
MD5 feea2b976523306d5b0ae258f5b6a684
BLAKE2b-256 0bd0a4b838fd3e547dca91e375dd8548fa3b7d1801988cc9563429034dcc6d8b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.15-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 749.1 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.15-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 fd0a6459ab6afa93c8bcda7fbc51f084a67f1aa0fdebf4cf43e6e1ecbca74438
MD5 da8ffc766fdd2c57cf73274272a47607
BLAKE2b-256 ba1af8128f9a2650eeed9c818bd1ff70425fafc734c67e7110c63fbba393d9a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.15-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 749.1 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.15-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 def42f355a930a7e0a8b6c7bd3ef4a9b7dc8480dde67064bf5a3550687062b39
MD5 2cdcfb7c460f22e1f602df2fea7efee7
BLAKE2b-256 fee0ae34ad6e8a23c243fab4057214920c4818d7bd634c3bbf58bba378b0acf1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.15-cp313-cp313-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 840.9 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.15-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 63efe710a11b2c3afb3488c6d003d1ca7850d38d356510d870b81d83fc59178e
MD5 c1e2fb6f54512109da5854115293e240
BLAKE2b-256 493afa4d88707902bed11b37db36f8a77eddd579e447eea9bc934966aa1f33d4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.15-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 795.0 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.15-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 328ceafa7d38c983c25d85f027799fe73578cb33bf11a33c153fda8dc514984b
MD5 5e95d593a86402d34d61a1201b24c822
BLAKE2b-256 7f1734c3b3265e3d0a0fba9fdc847877ef40b67e936e04aef8cde472f3c47005

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.15-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 749.1 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.15-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a5503c66f7b2fee7393e4b3ee89dc858e86ce62d624bbd2987a3b14ad2d4b5a0
MD5 a3141719ed130fd4d3e5105a27c3a065
BLAKE2b-256 6153bd4b47e5c49f18ee60509d30d994937234c8cefeda9f78d425116fbb3346

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.15-cp312-cp312-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 841.0 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.15-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a1ecbfcddd3678ac6bb8c89865a4a3a878b222dc8ce88e4d4bf91c0190812c56
MD5 e2b0047bb0b69ff7a78d6812f013fa1a
BLAKE2b-256 d7d726d951e36949905adc2a23e4223b6980935e1b54cacdbb04e66694444b2b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.15-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 795.0 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.15-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 805d520b987661b665a51aec64cd07035d26bb4e75302f8a4c2d471711b1eec1
MD5 229bda74cbbfa7d942897986ac15c141
BLAKE2b-256 21dd0426653c3f1ee5cc716fde157faf89ca2a741f39df8cc7ca05ffbd5cb0a0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.15-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 748.8 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.15-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ea86c688d507741b74f17276370f08e403f43a0dc30c71443082917f2df22e72
MD5 00a66e670c399e0ec52cb82e8d7ae6d9
BLAKE2b-256 4aca5d00a7f7167e376687216a66255c0f1ed63cec015a541c056ac283700899

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.15-cp311-cp311-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 842.5 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.15-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 da3771746e2439c8eaf733bdae847dbe560e7556c0495336defaa89c47ac6bac
MD5 277bbe7d7822332b100bfd5f74c103d6
BLAKE2b-256 1e736217f6bdbfcaa182730f958cd17e87d66c906c9571811ff477f441d664e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fraiseql_confiture-0.8.15-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 795.3 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.15-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3b13e56242f96183a3a1bdba93a68f1d8c22440f06a90f5c2b2bc263b1381a1b
MD5 7a59bfa401a9fabbfa9e53e8085de1d2
BLAKE2b-256 c880feb334c6f6b63f60fe58081deecaf1c4c75c38a4e1c67d8b7c39b988f097

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