Skip to content

gianluca-pettenon/schemy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

SCHEMY

Schema design that feels like yours.

Beta Live App


SCHEMY

✦ What is Schemy?

Schemy is a web-based IDE for modeling database schemas using a clean, declarative DSL. Write your tables and relationships as code and watch a live entity-relationship diagram render instantly on the side — no drag-and-drop, no clunky UI, just schema design the way developers like it.

When you're done, export clean SQL ready for PostgreSQL, SQLite, Oracle, SQL Server, and more.


✨ Features

  • Schema as Code — Model your database using a simple, readable DSL
  • Live Diagram Preview — Entity-relationship diagram updates in real time as you type
  • SQL Export — Generate clean, production-ready SQL for multiple databases
  • Universal Compatibility — PostgreSQL, Oracle, SQL Server, SQLite and more
  • Zero Lock-in — Free and open to the engineering community
  • Fast & Lightweight — Engineered for speed; start modeling instantly with no setup

🚀 Getting Started

Head over to schemy.app and click Get Started — no credit card required.

Table users {
  id        uuid      [pk]
  email     varchar   [unique, not null]
  name      varchar
  createdAt timestamp
}

Table posts {
  id        uuid    [pk]
  title     varchar [not null]
  body      text
  author_id uuid    [ref: > users.id]
}

As you type, the diagram renders automatically — and you can export the SQL at any time.


📖 DSL Reference

Tables

Define entities with the Table keyword followed by a column block. You can customize node colors on the diagram using [color: #6366f1].

Table orders [color: #f97316] {
  id uuid [pk]
  total decimal(10,2)
}

Columns

Follow the name type [options] pattern:

Option Description
pk / [pk] Sets the column as a primary key
increment Enables auto-increment for numeric fields
not null Prevents null values
unique Ensures unique values across all records
nullable Explicitly allows null values
note: '...' Adds a semantic annotation to the column

Relationships

Connect tables using Ref with directional operators:

author_id uuid [ref: > users.id]   // many-to-one  (N→1)
post_id   uuid [ref: < posts.id]   // one-to-many  (1→N)

Supported Types

DSL Input PostgreSQL Output
int, integer integer
bigint bigint
string, text text
bool, boolean boolean
float real
double double precision
decimal(p,s) numeric(p,s)
varchar(n) varchar(n)
uuid uuid
date date
timestamp, datetime timestamp without time zone

Rules

  • Keywords are case-insensitive: Table, TABLE, and table all work
  • Blank lines are ignored during parsing
  • Syntax errors return the exact line number
  • Primary keys can be defined with pk or [pk] after the type
  • Relationships are declared using Ref between columns
  • Table header color supports [color: value]
  • Options like [not null], [unique], and [increment] are supported

🗄️ Full Schema Example

Table users [color: #6366f1] {
  id         uuid      [pk]
  email      varchar   [unique, not null]
  name       varchar
  created_at timestamp [not null]
}

Table posts [color: #f97316] {
  id         uuid    [pk]
  title      varchar [not null]
  body       text
  author_id  uuid    [ref: > users.id]
  created_at timestamp
}

Table comments {
  id         uuid [pk]
  content    text [not null]
  post_id    uuid [ref: > posts.id]
  user_id    uuid [ref: > users.id]
  created_at timestamp
}

📦 SQL Export

Schemy exports clean SQL compatible with:

  • PostgreSQL
  • SQLite
  • Oracle
  • SQL Server

Just model your schema and click Export — the output is ready for your database layer with no modifications needed.


📄 Documentation

Full DSL reference available at schemy.app/docs.


📬 Contact

Have questions or feedback?

About

Schema design that feels like yours.

Resources

Stars

Watchers

Forks

Contributors