Skip to content

Json To Sql API

POST https://api.findutils.com/api/tools/json-to-sql/execute

Convert a JSON array of objects into SQL INSERT statements, optionally preceded by a CREATE TABLE. Column types come from the real JSON values, so booleans stay booleans and null becomes NULL rather than the text "null". A nested object or array is stored as JSON text. Identifiers are quoted for the chosen dialect (Postgres, MySQL or SQLite). A single object is treated as one row, and NDJSON is accepted. Nothing is executed against a database.

Request body

application/json
  • json

    string required

    A JSON array of objects, a single object, or NDJSON.

  • table

    string optional

    Target table name. Default: "my_table". Default "my_table".

  • dialect

    string optional

    Identifier quoting and type names. Default: postgres. One of postgres · mysql · sqlite. Default "postgres".

  • create_table

    boolean optional

    Emit a CREATE TABLE before the inserts. Default: true. Default true.

  • batch

    boolean optional

    Emit multi-row INSERTs instead of one statement per row. Default: false. Default false.

Example arguments

Verified
{
  "json": [
    {
      "id": 1,
      "name": "Ada",
      "active": true
    }
  ],
  "table": "people",
  "dialect": "postgres"
}