Convert SQL to JSONL

Turn SQL files into JSONL files. The tables the script creates are loaded first, with a dump from MySQL, MariaDB or PostgreSQL rewritten into SQLite's dialect.

Converted in an isolated sandbox on our serversDeleted after 24 hours

Drop SQL files on the dialor turn it to pick what to do

One JSONL file for each table in your script.Each row becomes one JSON object on its own line.

  1. What you get

    The tables the script creates are loaded first. Then you get one JSONL file per table, named after the table, with one object per row.

    Numbers and nulls keep their types in the output. Binary values are written as escaped text.

  2. Dumps from other databases

    A dump from MySQL, MariaDB or PostgreSQL is rewritten into SQLite's dialect before it is loaded. PostgreSQL true and false become 1 and 0.

    Dates that are not real dates, such as MySQL's 0000-00-00, are left empty.

  3. What it leaves out

    Views, functions and triggers are left out with a warning. Only the tables and their rows are written to JSONL.

    To go the other way, use JSONL to SQL.

SQL and JSONL.What each format is.

The formats

From · SQL

SQL Script

SQL statements as text. A database dump that any SQL tool can read or replay.

Extensions
.sql
MIME type
application/sql
Kind
Text and data
To · JSONL

JSON Lines

JSON Lines, one JSON object per line, the format of logs and datasets.

Extensions
.jsonl .ndjson
MIME type
application/jsonl
Kind
Text and data

In your code.The same SQL to JSONL conversion through the API, for your app or your agent.

terminal
$ cv convert report.sql report/ --to jsonl
$ cv convert report.sql report/ --to jsonl

Questions.What people ask about SQL to JSONL.

01OF 04

One JSONL file for each table the script creates. Each file is named after its table.

They are not real dates, so they are left empty.

No. Views, functions and triggers are left out, and a warning tells you so.

Yes. It is rewritten into SQLite's dialect, and true and false become 1 and 0.

More conversions.Other ways in and out of SQL and JSONL.