Convert a MariaDB schema to Snowflake
Paste the CREATE TABLE statements from MariaDB and ERD Designer draws them as a model. Change the model's target database to Snowflake and every column's datatype is converted. You review each change before it is applied, then generate the Snowflake script.
What changes in the sample
Converted to Snowflake, 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.
| Column | MariaDB | Snowflake | Note |
|---|---|---|---|
customers.customer_id | INT identity | INTEGER | numbered by the database |
customers.public_id | UUID | UUID | default: UUID() removed |
customers.notes | LONGTEXT | VARCHAR | |
customers.is_active | TINYINT(1) | BOOLEAN | default: 1 → TRUE |
customers.last_ip | INET6 | IPADDRESS | |
customers.created_at | DATETIME(3) | TIMESTAMP_NTZ(3) | default: CURRENT_TIMESTAMP(3) → CURRENT_TIMESTAMP |
orders.order_id | BIGINT identity | INTEGER | numbered by the database |
orders.customer_id | INT | INTEGER | |
orders.status | ENUM | VARCHAR(7) | |
orders.total | DECIMAL(12,2) | NUMBER(12,2) | |
orders.placed_at | DATETIME | TIMESTAMP_NTZ | |
orders.receipt_pdf | MEDIUMBLOB | BINARY |
What you are asked
Where Snowflake offers more than one fair answer, ERD Designer asks before it converts — once per kind of column, not once per column. For this page each question was answered with its first option:
orders.status — answered VARCHAR(7)
VARCHAR(7)— this column, held to the list by a CHECK constraintLookup table— a new table holding the values, keyed by the value itself, with a foreign key from this column
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:
- customers.public_id: Snowflake has no function this engine writes that generates a UUID — default UUID() removed; generate the values in your application.
- Snowflake has no indexes on ordinary tables — it partitions and prunes automatically — so none was created for: orders (placed_at).
The Snowflake script
This is what ERD Designer generates for the sample, for Snowflake. Our test suite applies this conversion to a real Snowflake server and then reads the database back to confirm it matches the model exactly.
-- NOTE: Snowflake does not enforce PRIMARY KEY, UNIQUE or FOREIGN KEY — only NOT NULL.
-- They document the design and inform the optimiser; nothing prevents a duplicate or an orphan.
-- Names are written exactly as in the model, in double quotes: a lower-case name must be
-- queried in quotes ("customers"), because Snowflake reads an unquoted name as upper case.
-- IDENTITY numbers are unique but, by default, not in the order rows were inserted (NOORDER).
-- Create table customers
CREATE TABLE "customers" (
"customer_id" INTEGER IDENTITY(1,1) NOT NULL,
"public_id" UUID NOT NULL,
"email" VARCHAR(255) NOT NULL,
"full_name" VARCHAR(120) NOT NULL,
"notes" VARCHAR,
"is_active" BOOLEAN NOT NULL DEFAULT TRUE,
"last_ip" IPADDRESS,
"created_at" TIMESTAMP_NTZ(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
CONSTRAINT "customers_PK" PRIMARY KEY ("customer_id")
);
-- Create table orders
CREATE TABLE "orders" (
"order_id" INTEGER IDENTITY(1,1) NOT NULL,
"customer_id" INTEGER NOT NULL,
"status" VARCHAR(7) NOT NULL DEFAULT 'new',
"total" NUMBER(12,2) NOT NULL,
"placed_at" TIMESTAMP_NTZ NOT NULL,
"receipt_pdf" BINARY,
CONSTRAINT "orders_PK" PRIMARY KEY ("order_id"),
CONSTRAINT "orders_status_check" CHECK ("status" IN ('new', 'paid', 'shipped'))
);
-- Add unique constraint on customers (email)
ALTER TABLE "customers" ADD CONSTRAINT "customers_email_uq" UNIQUE ("email");
-- Add foreign key orders (customer_id) → customers (customer_id)
ALTER TABLE "orders" ADD CONSTRAINT "orders_customer_fk" FOREIGN KEY ("customer_id") REFERENCES "customers" ("customer_id");
How to convert your own schema
- Paste your MariaDB script above and click the Open in ERD Designer button. The model opens laid out and ready to edit.
- Click the model's name in the toolbar to open the Edit Model form dialog, select Snowflake in the Target Database / Version list, and click the Apply Changes button.
- If Snowflake offers more than one way to store a kind of column, choose one and click the Continue button.
- Read the list of retyped columns and any warnings, then click the Apply Conversion button. Save the model to keep it.
- Press Generate DDL (the database icon) to copy or download the Snowflake script — or apply it to a database on your own network with the ERD Designer Agent.
What it reads, and what it does not
- It reads
CREATE TABLE,ALTER TABLE … ADD CONSTRAINTandCREATE INDEX: tables, columns, keys, foreign keys, unique constraints, check lists and indexes. Anything else in the script is skipped and listed. - It converts the schema, never the data: no rows are read, moved or changed.
- It does not convert views, stored procedures, functions, triggers or packages.
Which plan you need
Pasting a script and working with it as a model is free on the Basic plan, with no card. Converting a model 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
- MariaDB to PostgreSQL
- MariaDB to Oracle
- MariaDB to SQL Server
- MariaDB to MySQL
- MariaDB to SQLite
- MariaDB to Amazon Redshift
- MariaDB to Google BigQuery
- PostgreSQL to Snowflake
- Oracle to Snowflake
- SQL Server to Snowflake
- MySQL to Snowflake
- SQLite to Snowflake
- Amazon Redshift to Snowflake
- Google BigQuery to Snowflake
Questions? Write to support@erddesigner.com. · ERD Designer™ · Terms · Privacy
ERD Designer™ is a trademark of ERD Designer, LLC.