Paste SQL
Paste SQL directly into TalkingSchema to import a schema without creating a file.
Steps
- Click the Import button in the top toolbar
- Select Paste SQL
- Paste your SQL into the text area
- Click Import
- TalkingSchema parses the SQL and populates the ERD
What to paste
Paste any SQL containing CREATE TABLE statements:
CREATE TYPE carbon_tier AS ENUM ('A', 'B', 'C', 'D');
CREATE TABLE suppliers (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
carbon_tier carbon_tier NOT NULL DEFAULT 'C',
country VARCHAR(100),
is_active BOOLEAN NOT NULL DEFAULT TRUE,
created_at TIMESTAMP NOT NULL DEFAULT NOW()
);
CREATE TABLE products (
id SERIAL PRIMARY KEY,
supplier_id INTEGER NOT NULL REFERENCES suppliers(id),
name VARCHAR(255) NOT NULL,
sku VARCHAR(100) NOT NULL UNIQUE,
carbon_intensity_score DECIMAL(5,2) NOT NULL DEFAULT 0,
unit_price DECIMAL(10,2) NOT NULL DEFAULT 0,
created_at TIMESTAMP NOT NULL DEFAULT NOW()
);
Use cases
- Copy schema from your database GUI (pgAdmin, TablePlus, DBeaver)
- Import from a migration file snippet
- Try TalkingSchema with an existing schema without uploading a file
Related
- Import SQL File — upload a SQL file instead of pasting
- Paste DBML — import using DBML format instead
- SQL Export — export your schema back to SQL