DevForge

Markdown table to SQL

Seed data usually starts life in a document. This turns a Markdown table into the statements needed to put it in a database: a CREATE TABLE with types inferred from the column contents, and batched INSERTs with identifiers and string literals quoted the way your dialect expects.

markdown
sql
options
format
grid

Technical Guide & Mechanics

Rapid Database Seeding from Markdown Tables

When prototyping applications or writing database migrations, developers often start with tabular data in product requirement docs or spreadsheets. Writing individual SQL CREATE TABLE and INSERT INTO statements by hand is tedious and prone to syntax errors across different database engines.

This generator inspects column values to infer appropriate database types (such as INTEGER, NUMERIC, DATE, BOOLEAN, and VARCHAR/TEXT). It produces production-ready SQL migrations tailored to your target dialect: PostgreSQL, MySQL, SQLite, or Microsoft SQL Server.

Dialect-specific escape rules are strictly enforced: PostgreSQL and SQLite identifiers use double quotes and doubled single quotes for text escaping, MySQL applies backtick quotes and backslash escapes, and SQL Server batches insert statements into 1,000-row chunks to prevent parameter limit violations.

how to use it

  1. 01Paste Markdown containing a table.
  2. 02Pick your SQL dialect and name the table.
  3. 03Copy the statements into a migration or a psql session.

questions

How are column types chosen?
From the values: all whole numbers give INTEGER, decimals give NUMERIC, true and false give BOOLEAN, ISO dates give DATE, and anything else stays TEXT.
Is my data escaped safely?
Single quotes are doubled, and for MySQL backslashes are escaped too, since MySQL treats them as escape characters inside string literals where the others do not.
Why is SQL Server output split into batches?
A multi-row VALUES clause in SQL Server is capped at 1000 rows, so longer tables are emitted as several INSERT statements.
Can I customize the generated table name?
Yes, you can edit the table identifier directly before generating the final SQL migration script.

related