Getting Started
Everything you need to design, build, and export database schemas with Skemio.
Installation & Setup
Install the Skemio CLI and authenticate with your account to get started.
# Install the Skemio CLI globally
npm install -g @skemio/cli
# Authenticate with your account
skemio auth login
# Initialize a new project
skemio init my-databaseCreating Your First Schema
Initialize a schema with a name, target database, and description.
// Create a new schema programmatically
import { Skemio } from "@skemio/sdk";
const skemio = new Skemio({ apiKey: process.env.SKEMIO_API_KEY });
const schema = await skemio.schemas.create({
name: "my-app-db",
database: "postgresql",
description: "Main application database",
});Adding Tables & Attributes
Define tables with typed attributes, constraints, and default values.
// Add a users table
await skemio.tables.create(schema.id, {
name: "users",
attributes: [
{ name: "id", type: "uuid", primaryKey: true, default: "gen_random_uuid()" },
{ name: "email", type: "varchar(255)", unique: true, notNull: true },
{ name: "name", type: "varchar(255)", notNull: true },
{ name: "created_at", type: "timestamp", default: "now()" },
],
});Defining Relationships
Connect tables with foreign key relationships and cascade rules.
// Define a one-to-many relationship
await skemio.relationships.create(schema.id, {
from: { table: "users", attribute: "id" },
to: { table: "posts", attribute: "author_id" },
type: "one-to-many",
onDelete: "CASCADE",
});Exporting Code
Export your schema to production-ready code in your preferred language and ORM.
# Export to TypeScript (Drizzle ORM)
skemio export --schema my-app-db --lang typescript --orm drizzle
# Export to Python (SQLAlchemy)
skemio export --schema my-app-db --lang python --orm sqlalchemy
# Export raw SQL migrations
skemio export --schema my-app-db --format sql --output ./migrationsKey Concepts
A complete database design containing tables, relationships, and constraints.
A data entity with named attributes, types, and constraints like PK/FK.
A column in a table with a data type, default value, and optional constraints.
A connection between tables — one-to-one, one-to-many, or many-to-many.
A versioned set of SQL statements that evolves your database schema.
An isolated environment containing schemas, settings, and team members.
Canvas Controls
Troubleshooting
Clear your browser cache and ensure WebGL is enabled. Try disabling browser extensions that may interfere with canvas rendering.
Ensure your schema has at least one table with one attribute. Check the output language selector in the export dialog.
Check your network connection. Skemio requires a stable WebSocket connection for real-time collaboration.
Run `skemio auth login` to re-authenticate. Ensure your API key hasn't expired in Settings > API Keys.
API Reference
/api/v1/schemasList all schemas in your workspace/api/v1/schemasCreate a new schema/api/v1/schemas/:idGet schema by ID with all tables/api/v1/schemas/:idUpdate an existing schema/api/v1/schemas/:id/exportExport schema to code/api/v1/schemas/:idDelete a schemaNeed More Help?
Join our community or reach out to support at hello@skemio.tech.