Data models,
as plain text.

bluep is a data modeling tool. It keeps a database schema as readable files in git, and generates DDL, migrations and documentation for twelve databases.

Read the tutorial
model.bluep
entity customer {
  description "A registered buyer."
  term Customer
  attribute id : bigint not null
  attribute email : domain email
  attribute full_name : text(200) not null
  attribute created_at : timestamptz not null default expr "now()"
  key primary pk_customer (id)
  key unique uq_customer_email (email)
}
Generated for PostgreSQL
CREATE TABLE public.customer (
  id bigint NOT NULL GENERATED ALWAYS AS IDENTITY,
  email varchar(320) NOT NULL,
  full_name varchar(200) NOT NULL,
  created_at timestamp with time zone NOT NULL DEFAULT now(),
  CONSTRAINT pk_customer PRIMARY KEY (id),
  CONSTRAINT uq_customer_email UNIQUE (email),
  CONSTRAINT ck_customer_email CHECK (email ~ '^[^@]+@[^@]+$')
);

Reviewed like code

One canonical text format, so a schema change is a diff. Model-aware three-way merge and reviews are built in.

Diff and migrate

Compare a model with another version or a live database, and write ordered migration scripts.

Drift

Report where a deployed database has moved from the model, and pull approved changes back.

Twelve databases

Generate and import DDL for PostgreSQL, MySQL, SQL Server, Oracle, Snowflake, BigQuery and six more.

Documentation

A static data dictionary and SVG or PDF diagrams, generated from the same model.

Local

One binary with a browser editor. No server, no account. It connects only to databases you name.

Databases

DatabaseSupport
PostgreSQLDDL, import, diff, migration, live database
SQLiteDDL, import, diff, migration, live database
MySQLDDL, import, diff, migration, live database
SQL ServerDDL, import, diff, migration, live database
OracleDDL, import, diff, migration, live database
SnowflakeDDL, import, diff, migration, live database
BigQueryDDL, import, diff, migration, live database
RedshiftDDL, import, diff, migration, live database
DatabricksDDL, import, diff, migration, live database
Db2DDL, import, diff, migration, live database
TeradataDDL, import, diff, migration, live database
MongoDBDocument validators, indexes, import, diff, migration

Install

Not released yet. bluep will ship as a single binary for macOS and Linux. Until then, see the examples.