Build from DDL
Instant database creation from your DDL files in under 1 second.
FraiseQL is database-first — you write SQL tables and views, and FraiseQL maps them to GraphQL. But who manages the database itself? You confiture it.
confiture /kɔ̃.fi.tyʁ/ — French for jam, preserve. Sounds like configure. That’s the point.
Confiture is a database schema evolution framework that provides four strategies (“Mediums”) for every database lifecycle scenario. It treats your DDL files as the single source of truth, not migration history. You don’t configure your database — you confiture it.
| Medium | What It Does | When to Use |
|---|---|---|
| Build | Creates a fresh database from DDL files in under 1s | Development, CI/CD, testing |
| Migrate | Applies incremental ALTER statements | Production schema changes |
| Sync | Copies production data with anonymization | Realistic local development |
| Schema-to-Schema | Zero-downtime migration via FDW | Major production refactoring |
The typical development cycle:
# 1. Write your SQL (tables in 01_write/, views in 02_read/)vim db/schema/01_write/tb_order.sqlvim db/schema/02_read/v_order.sql
# 2. Build fresh databaseconfiture build --env local
# 3. Define GraphQL typesvim schema.py
# 4. Compile the mappingfraiseql compile
# 5. Servefraiseql runFor existing databases:
# 1. Update SQL filesvim db/schema/01_write/tb_user.sql # Add new column
# 2. Create migration for existing dataconfiture migrate generate add_avatar_url
# 3. Apply migrationconfiture migrate up --env local
# 4. Update view to include new fieldvim db/schema/02_read/v_user.sql
# 5. Rebuild views (or apply view migration)confiture build --env local --views-only
# 6. Recompile and servefraiseql runConfiture uses a confiture.yaml configuration file:
project: name: my-fraiseql-app
environments: local: database: host: localhost port: 5432 database: myapp user: postgres password: postgres schema_dirs: - db/schema/00_extensions - db/schema/01_write - db/schema/02_read - db/schema/03_functions migrations_dir: db/migrations
production: database: host: ${DB_HOST} port: ${DB_PORT} database: ${DB_NAME} user: ${DB_USER} password: ${DB_PASSWORD} schema_dirs: - db/schema/00_extensions - db/schema/01_write - db/schema/02_read - db/schema/03_functions migrations_dir: db/migrations| Scenario | Medium | Command |
|---|---|---|
| Fresh dev environment | Build | confiture build --env local |
| CI/CD test database | Build | confiture build --env ci |
| Add column to production | Migrate | confiture migrate up |
| Test with realistic data | Sync | confiture sync --from prod --to local --anonymize |
| Rename column on 50M row table | Schema-to-Schema | confiture migrate schema-to-schema ... |
| Reset local database | Build | confiture build --env local |
Build from DDL
Instant database creation from your DDL files in under 1 second.
Incremental Migrations
Schema evolution with data for existing production databases.
Production Data Sync
Safe data synchronization with built-in PII anonymization.
Schema-to-Schema
Zero-downtime refactoring for major production changes.