Blog/Announcements

Six database engines, and where they're hosted

PostgreSQL, MySQL, MariaDB, SQLite, SQL Server and Oracle, each with SQL written its own way, plus the hosted versions and their differences.

Announcements5 min read

Diagrams started out speaking mostly PostgreSQL. From today every diagram has an engine, chosen from six: PostgreSQL, MySQL, MariaDB, SQLite, SQL Server and Oracle. Everything the app writes follows it.

SQL the way each engine wants it

Each engine is described once, as data: how it quotes names, which types it has, how it spells auto-increment, what it can and can't alter in place, how it stores comments. Every export, migration and type picker reads from that description, so the output looks like something a person who knows the engine would write. A few examples of what that means:

  • SQL Server output puts GO between batches, gives defaults a name (DF_<table>_<column>) and uses CREATE OR ALTER VIEW.
  • Oracle folds unquoted names to upper case, so lowercase names are written bare and read back lowercase. Identity columns, NUMBER, VARCHAR2 and CLOB replace the PostgreSQL spellings.
  • SQLite can't alter most things in place, so a migration rebuilds the table from its new definition and copies the rows across.
  • MariaDB is MySQL's description with its own differences on top, such as a native UUID type.

The type picker follows the engine too. It lists the common types every engine understands (serial, uuid, text, varchar(255), int, bigint, numeric, boolean, timestamp, date, json), then the engine's own types, then the branch's enums.

One table, two engines

Here's a small sales.orders table with an enum-typed state column (open or shipped) defaulting to 'open', and a view over it. This is the SQL Server export, exactly as written:

IF SCHEMA_ID(N'sales') IS NULL EXEC(N'CREATE SCHEMA [sales]');
GO

CREATE TABLE [sales].[orders] (
  [id] INT IDENTITY(1,1) NOT NULL,
  [state] NVARCHAR(7) CONSTRAINT [DF_orders_state] DEFAULT 'open' NOT NULL,
  [placed_at] DATETIME2 NOT NULL,
  PRIMARY KEY ([id]),
  CHECK ([state] IN ('open', 'shipped'))
);
GO

CREATE VIEW [sales].[open_orders] AS SELECT id FROM sales.orders WHERE state = 'open';
GO

SQL Server has no enum type, so the enum becomes a column sized to its longest value plus a CHECK. serial becomes IDENTITY(1,1) and timestamp becomes DATETIME2.

Oracle handles a users and posts pair like this:

CREATE TABLE posts (
  id NUMBER(19) GENERATED BY DEFAULT AS IDENTITY NOT NULL,
  user_id NUMBER(10) NOT NULL,
  body CLOB,
  PRIMARY KEY (id)
);

CREATE TABLE users (
  id NUMBER(10) GENERATED BY DEFAULT AS IDENTITY NOT NULL,
  "Email" VARCHAR2(255) NOT NULL UNIQUE,
  "level" VARCHAR2(5) NOT NULL,
  active NUMBER(1) DEFAULT 1 NOT NULL,
  PRIMARY KEY (id),
  CHECK ("level" IN ('basic', 'admin'))
);

ALTER TABLE posts ADD CONSTRAINT fk_posts_user_id FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE /* ON UPDATE CASCADE: Oracle has no ON UPDATE action */;

Most names are bare. "Email" is quoted because it has a capital letter that Oracle would otherwise fold away, and "level" because it's a reserved word there. The foreign key was drawn with ON UPDATE CASCADE, which Oracle doesn't have, so the export says so in a comment instead of writing SQL that fails.

Common types map like this:

TypeMySQLSQL ServerOracle
uuidCHAR(36)UNIQUEIDENTIFIERRAW(16)
booleanTINYINT(1)BITNUMBER(1)
serialINT AUTO_INCREMENTINT IDENTITY(1,1)NUMBER(10) GENERATED BY DEFAULT AS IDENTITY

When an engine can't change a column in place

Migrations are where engines differ most. Change users.age from integer to bigint and PostgreSQL gets one statement per aspect that changed:

ALTER TABLE "users" ALTER COLUMN "age" TYPE BIGINT;

MySQL restates the column:

ALTER TABLE `users` MODIFY COLUMN `age` BIGINT;

SQLite can't do either, so the migration rebuilds the table:

-- Run this outside a transaction: inside one SQLite ignores PRAGMA foreign_keys, and dropping a rebuilt table would fire its children's ON DELETE actions.
PRAGMA foreign_keys = OFF;

-- Rebuild "users": SQLite can't change it in place.

CREATE TABLE "_new_users" (
  "id" INTEGER NOT NULL,
  "age" BIGINT,
  PRIMARY KEY ("id")
);

INSERT INTO "_new_users" ("id", "age") SELECT "id", "age" FROM "users";

DROP TABLE "users";

ALTER TABLE "_new_users" RENAME TO "users";

PRAGMA foreign_key_check;

PRAGMA foreign_keys = ON;

The same rebuild covers anything else SQLite can't alter in place, such as adding, dropping or changing a foreign key or a check constraint. The final foreign_key_check lists any foreign key the copied rows now break.

Where it's hosted

An engine often runs somewhere with its own rules. Diagram settings (in the editor's overflow menu, or "Diagram settings…" in the command palette) has a "Hosted on" choice beside the engine. It starts at Anywhere, and the list depends on the engine: Amazon RDS and Aurora, Google Cloud SQL, Azure, Neon, Supabase, CockroachDB Cloud, PlanetScale, TiDB Cloud, Turso, Cloudflare D1, Azure SQL Database and Oracle Autonomous Database among them.

The host changes the details only where it differs. Cloudflare D1 is the clearest case: it keeps foreign keys on and ignores PRAGMA foreign_keys, so a rebuild there wraps itself in PRAGMA defer_foreign_keys = on; instead. Dropping the old table would still fire the ON DELETE CASCADE or SET NULL actions of tables that point at it, so for a table like that the migration doesn't rebuild. It writes a comment naming the child tables and asks you to make that change by hand.

The host also shapes the live import: an example connection string, where to find yours in the host's console, and for Amazon RDS and Aurora the certificate bundle to trust.

Changing engine

Switching a diagram's engine is a reviewed change, not a silent conversion. Pick a new engine in Diagram settings and press Save. If the switch would change any column's type on the open branch, the merge review opens with "Column types for" the new engine, listing each column whose type changes, and nothing is applied until you confirm.

Columns store portable types like uuid, text and timestamp where they can, and those carry over unchanged. A type written for the old engine is respelled when the new one has an equivalent, keeping its arguments where it can (Oracle's number(10,2) becomes decimal(10,2) on MySQL). A type with no equivalent stays as it was, and the review lists it as a warning, such as "has no SQL Server equivalent; kept as is", so you can fix it by hand. Enum-typed columns keep their enum.

Reading a live database understands each engine's own spellings too, so MySQL's int(11) and PostgreSQL's int4 both land as int, and MySQL's tinyint(1) lands as boolean.

Reading live databases

Live import (Import from database) now reads all six. SQL Server and Oracle join PostgreSQL and MySQL, MariaDB is read over the MySQL protocol, and hosted SQLite comes from Turso or Cloudflare D1. A read can take several namespaces at once: schemas in PostgreSQL and SQL Server, databases in MySQL, owners in Oracle.

Some engines report less than others, and the import says what it couldn't know rather than guessing. MySQL only lists check constraints from 8.0.16 (MariaDB from 10.2). MySQL's inline ENUM columns become enums named <table>_<column>. For anything older, checks count as unknown, so a later merge won't treat them as removed.

An uploaded .sqlite file is opened in your browser and never reaches our servers.

More announcements

  • Convex schemas, in and out

    19 November 2026 · 6 min read

    Export a diagram as convex/schema.ts from any engine, paste one in, or check one out from a repository, and what happens to the parts Convex can't hold.

  • Snippets: drop-in table sets that stay up to date

    10 November 2026 · 6 min read

    About a hundred ready-made table sets for payments, auth, teams and more, inserted into the schema you already have and updated without losing your edits.

  • A vault we can't open, and a local agent

    6 November 2026 · 6 min read

    Database credentials sealed in your browser with a workspace key our servers never see, and a small agent that reads databases from your own machine.

Try it on your own schema

One diagram with two branches, no card needed. Upgrade when your team needs more.