🗄️ JSON 转 SQLJSON to SQL Converter
把 JSON 数组生成 SQL:自动推断列类型生成 CREATE TABLE,批量生成 INSERT 语句,支持 MySQL、PostgreSQL、SQLite、SQL Server,字符串安全转义。Generate SQL from a JSON array: CREATE TABLE with inferred column types plus batched INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server, with safe string escaping.
使用说明与常见问题How-to & FAQ
「JSON 转 SQL」是什么?What is the JSON to SQL Converter tool?
把 JSON 数组生成 SQL:自动推断列类型生成 CREATE TABLE,批量生成 INSERT 语句,支持 MySQL、PostgreSQL、SQLite、SQL Server,字符串安全转义。Generate SQL from a JSON array: CREATE TABLE with inferred column types plus batched INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server, with safe string escaping.
如何使用「JSON 转 SQL」?How do I use the JSON to SQL Converter tool?
在「JSON 转 SQL」中,把内容粘贴或输入到上方输入框,按需设置「数据库」、「表名」,结果会实时显示在下方,点击「复制结果」即可复制。In the JSON to SQL Converter: Paste or type into the input box, adjust "Dialect", "Table name"; the result appears below instantly — click "Copy result" to copy it.
列类型是怎么推断的?How are column types inferred?
扫描每一列的所有非空值:全是整数用 INT(超过 21 亿用 BIGINT),有小数用 DOUBLE/REAL,布尔用 BOOLEAN/BIT,嵌套对象或数组用 JSON/JSONB,文本用 VARCHAR(255)(更长用 TEXT),类型混杂时用文本。生成后请按实际需要调整长度、主键和索引。Each column's non-null values are scanned: all integers → INT (BIGINT beyond ±2.1 billion), decimals → DOUBLE/REAL, booleans → BOOLEAN/BIT, nested objects or arrays → JSON/JSONB, text → VARCHAR(255) (TEXT if longer), mixed types → text. Adjust lengths, keys and indexes to your needs.
字符串转义安全吗?Is string escaping safe?
单引号会转成两个单引号(标准 SQL),MySQL 下反斜杠也会转义,SQL Server 使用 N'…' 保存 Unicode;标识符用对应数据库的方式加引号。生成的是静态 SQL 文本,执行前仍建议检查。Single quotes are doubled (standard SQL), backslashes are escaped for MySQL, SQL Server uses N'…' for Unicode, and identifiers are quoted per dialect. It is static SQL text — still review it before running.
一次能转多少行?How many rows at once?
批量模式每 1000 行生成一条 INSERT(SQL Server 单条 VALUES 的上限),数据量只受浏览器内存限制。Batch mode emits one INSERT per 1,000 rows (SQL Server's VALUES limit); size is otherwise limited only by browser memory.
数据会上传吗?Is my data uploaded?
不会。转换完全在浏览器本地进行,适合处理内部数据。No. Conversion happens entirely in your browser, so it is safe for internal data.
「JSON 转 SQL」免费吗?需要注册吗?Is the JSON to SQL Converter free? Do I need an account?
「JSON 转 SQL」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The JSON to SQL Converter is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.