holistics / dbml

Database Markup Language (DBML), designed to define and document database structures
https://dbml.org
Apache License 2.0
2.91k stars 171 forks source link
dbx

DBML - Database Markup Language

[![Build Status](https://img.shields.io/github/actions/workflow/status/holistics/dbml/test.yml?label=CI&logo=github&style=flat-square)](https://github.com/holistics/dbml/actions/workflows/test.yml) [![npm @dbml/core](https://img.shields.io/npm/v/@dbml/core?style=flat-square&label=npm%20@dbml/core)](https://www.npmjs.org/package/@dbml/core) [![npm @dbml/core downloads](https://img.shields.io/npm/dm/@dbml/core.svg?style=flat-square)](https://npm-stat.com/charts.html?package=@dbml/core) [![npm @dbml/cli](https://img.shields.io/npm/v/@dbml/cli?style=flat-square&label=npm%20@dbml/cli)](https://www.npmjs.org/package/@dbml/cli) [![npm @dbml/cli downloads](https://img.shields.io/npm/dm/@dbml/cli.svg?style=flat-square)](https://npm-stat.com/charts.html?package=@dbml/cli)

DBML (database markup language) is a simple, readable DSL language designed to define database structures.

For more information, please check out DBML homepage

Benefits

Example

Example of a database definition of a simple blogging site:

Table users {
    id integer
    username varchar
    role varchar
    created_at timestamp
}

Table posts {
    id integer [primary key]
    title varchar
    body text [note: 'Content of the post']
    user_id integer
    created_at timestamp
}

Ref: posts.user_id > users.id // many-to-one

Community Contributions