This is built with regex, so all kinds of differences could break it - beware. If it looks similar to the below format, it will probably be okay. The most critical rules are that the table name comes after a CREATE TABLE statement, the table name and column names are encased in double quotes, and there is one comma & newline separating each column definition. If you need to modify your .sql, this tool likely isn't worth using. Feel free to fork.

Expected/supported .sql format:
                CREATE TABLE "table_name" (
                    "id" int unsigned NOT NULL AUTO_INCREMENT,
                    "column_1a" varchar(255) NOT NULL,
                    "column_2b" varchar(255) CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_0900_ai_ci' NULL,
                    "column_etc" int(10) NOT NULL DEFAULT 0,
                    PRIMARY KEY ("id")
                );
                
                CREATE TABLE "table_name2" (
                    "id" int unsigned NOT NULL AUTO_INCREMENT,..
            

Enter your .sql export here. No data/rows are required/parsed, only table definitions.




JSON output:


JavaScript helper class:



← Back to web-tools home |  GitHub Repo