Skip to content

How SQL Splitter works

Paste a multi-statement migration and get each statement as its own labelled card (CREATE TABLE, CREATE FUNCTION, CREATE TRIGGER, ALTER, and so on) with a Copy button, so you can run them one at a time in the Supabase SQL editor. The split is dollar-quote aware, so a PL/pgSQL function body is never cut in half on the semicolons inside it.

A quote-aware tokenizer splits on top-level semicolons only, ignoring ';' inside strings, comments, and $$ dollar-quoted bodies. Runs entirely in your browser.

Questions

Why not just split on semicolons?
Because a PL/pgSQL function body ($$ ... $$) contains its own semicolons. A naive split breaks the function in half. This splitter ignores semicolons inside strings, comments, and dollar-quoted bodies.
Is my SQL uploaded?
No. The whole split runs in your browser. Nothing leaves your device.
What are the labels for?
Each statement gets a best-effort label (CREATE TABLE, CREATE FUNCTION, ALTER, INSERT, and so on) by its leading keyword, so a long migration is easy to scan.
Can I copy everything at once?
Yes. Use Copy all (joined) for the whole script, or the per-card Copy button to grab a single statement.

More Text & Data tools

All the tools · How to check that nothing is sent

SQL Splitter, split a migration into statements | Only in the Tab