← Every conversion

Convert a Snowflake schema to SQLite

Paste the CREATE TABLE statements from Snowflake and ERD Designer draws them as a diagram. Change the diagram's target database to SQLite and every column's datatype is converted. You review each change before it is applied, then generate the SQLite script.

You sign up free and land on your diagram. Your script is held for 15 minutes and deleted from our server the moment you open it.

What changes in the sample

Converted to SQLite, these columns of the sample above change type. Everything else keeps its type; names, keys, nullability and lists of allowed values are left as they are.

ColumnSnowflakeSQLiteNote
CUSTOMERS.CUSTOMER_IDNUMBER(38,0) identityINTEGER
CUSTOMERS.NOTESVARCHARTEXT
CUSTOMERS.IS_ACTIVEBOOLEANBOOLEANdefault: TRUE → 1
CUSTOMERS.CREATED_ATTIMESTAMP_TZDATETIMEdefault: CURRENT_TIMESTAMP() → CURRENT_TIMESTAMP
ORDERS.ORDER_IDNUMBER(38,0) identityINTEGER
ORDERS.CUSTOMER_IDNUMBER(38,0)INTEGER
ORDERS.TOTALNUMBER(12,2)NUMERIC(12,2)
ORDERS.PLACED_ATTIMESTAMP_NTZ(3)DATETIME
ORDERS.RECEIPT_PDFBINARYBLOB

What it tells you

Where a conversion loses something, ERD Designer says so rather than picking for you. These are the messages for the sample:

The SQLite script

This is what ERD Designer generates for the sample, for SQLite. Our test suite applies this conversion to a real SQLite server and then reads the database back to confirm it matches the diagram exactly.

PRAGMA foreign_keys=OFF;

-- Create table CUSTOMERS
CREATE TABLE "CUSTOMERS" (
  "CUSTOMER_ID" INTEGER NOT NULL,
  "EMAIL" TEXT NOT NULL,
  "FULL_NAME" TEXT NOT NULL,
  "NOTES" TEXT,
  "IS_ACTIVE" INTEGER NOT NULL DEFAULT 1,
  "CREATED_AT" TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
  CONSTRAINT "CUSTOMERS_PK" PRIMARY KEY ("CUSTOMER_ID"),
  CONSTRAINT "CUSTOMERS_EMAIL_UQ" UNIQUE ("EMAIL")
);

-- Create table ORDERS
CREATE TABLE "ORDERS" (
  "ORDER_ID" INTEGER NOT NULL,
  "CUSTOMER_ID" INTEGER NOT NULL,
  "PUBLIC_ID" TEXT NOT NULL,
  "STATUS" TEXT NOT NULL DEFAULT 'new',
  "TOTAL" NUMERIC NOT NULL,
  "PLACED_AT" TEXT NOT NULL,
  "RECEIPT_PDF" BLOB,
  CONSTRAINT "ORDERS_PK" PRIMARY KEY ("ORDER_ID"),
  CONSTRAINT "ORDERS_FK1" FOREIGN KEY ("CUSTOMER_ID") REFERENCES "CUSTOMERS" ("CUSTOMER_ID")
);

-- Add unique constraint on CUSTOMERS (EMAIL)
-- stated inside CREATE TABLE "CUSTOMERS" above;

-- Add foreign key ORDERS (CUSTOMER_ID) → CUSTOMERS (CUSTOMER_ID)
-- stated inside CREATE TABLE "ORDERS" above;

PRAGMA foreign_keys=ON;

How to convert your own schema

  1. Paste your Snowflake script above and press Open in ERD Designer. The diagram opens laid out and ready to edit.
  2. Click the diagram's name in the toolbar to open its properties, choose SQLite under Target Database / Version, and press Apply Changes.
  3. If SQLite offers more than one way to store a kind of column, choose one and press Continue.
  4. Read the list of retyped columns and any warnings, then press Apply Conversion. Save the diagram to keep it.
  5. Press Generate DDL (the database icon) to copy or download the SQLite script — or apply it to a database on your own network with the ERD Designer Agent.

What it reads, and what it does not

Which plan you need

Pasting a script and working with it as a diagram is free on the Basic plan, with no card. Converting a diagram to another database is part of the Pro and Advanced plans, which also generate its script and can apply it through the Agent.

Other conversions

Questions? Write to support@erddesigner.com. · ERD Designer · Terms · Privacy