Documentation

Getting Started

Everything you need to design, build and export database schemas with TableCraftAI.

Installation & setup

The Studio runs in the browser with nothing to install. For terminal workflows, add the CLI to your project and authenticate once.

npm install -g @tablecraftai/cli
tablecraft login
tablecraft pull --schema billing

Creating your first schema

Open the Studio, name the schema, and pick a target database. Describe the product in the AI dialog to draft a starting point, or press New table to build it by hand.

# or start from a template
tablecraft init --template saas --name billing

Adding tables & columns

Select a table on the canvas to open the properties panel. Add columns, choose types, and mark primary keys, unique constraints and nullability.

create table members (
  id            uuid primary key,
  workspace_id  uuid not null,
  email         text not null unique,
  role          text not null
);

Defining relationships

Set a column's foreign key target in the properties panel. TableCraftAI draws the relationship, adds an index and includes the cascade rule in your export.

alter table members
  add constraint members_workspace_fk
  foreign key (workspace_id) references workspaces(id)
  on delete cascade;

Exporting code

Press Export to generate SQL for your dialect, plus Prisma models, TypeScript interfaces, Python dataclasses and DBML. Copy it or download the file.

tablecraft export --format prisma > schema.prisma
tablecraft export --format sql --dialect mysql > schema.sql

Ready to try it?

The Studio is free and runs entirely in your browser.

Open the Studio