Convert SQL to JSON lines (JSONL / NDJSON / LDJSON)

Want to convert SQL to JSON lines (JSONL / NDJSON / LDJSON)?

Try Withdata Data File Converter, a desktop SQL to JSON converter for Windows, MacOS, and Linux, Convert SQL to JSON lines, Easy and Fast.

  • Can run in GUI mode, Step by Step, just a few mouse clicks.
  • Can run in Command line, for Scheduled Tasks and Streams.
  • Convert files locally and privately, avoid uploading large SQL file(s) to online services.

Download DataFileConverter Download DataFileConverter

JSON Lines text format (JSONL), also called Newline-delimited JSON (NDJSON), or Line-delimited JSON (LDJSON). JSON Lines files may be saved with the file extension .jsonl, *.ndjson, *.ldjson.

Convert SQL to JSON lines (JSONL / NDJSON / LDJSON)

Choose SQL file -> Set target JSON Lines (JSONL / NDJSON / LDJSON) file -> Convert SQL to JSON lines (JSONL / NDJSON / LDJSON)

Click “Start a New Convert” at task dialog.

Convert SQL to JSONL - task window

then show the wizard.

Select source/target file type.

Convert SQL to JSONL - select type

1. Open a SQL file.

Convert SQL to NDSQL - open JSON lines file

The SQL content:

Convert SQL to NDSQL - JSON lines content

2. Config target JSON Lines (JSONL / NDJSON / LDJSON) file.

Convert SQL to LDSQL - config SQL file

3. Set rows options.

Convert SQL to JSONL - summary

4. Convert SQL to JSON lines (JSONL / NDJSON / LDJSON).

Convert SQL to NDJSON - convert

See JSON lines file

Convert SQL to LDJSON - view JSON lines file

Convert SQL to JSON lines (JSONL / NDJSON / LDJSON) in command line

Save “SQL to JSON Lines” session, then you can:

Set scheduled tasks for converting SQL to JSON lines (JSONL / NDJSON / LDJSON)

You can schedule and automate this converting task by:

  1. Save session and create .bat (Windows) or .sh (Linux/macOS) file for “SQL to JSON lines” conversion.
  2. Set scheduled task for “SQL to JSON lines” conversion.

FAQ

What is Withdata DataFileConverter?
How long does it take to convert SQL to JSON lines?
Is it safe to convert SQL to JSON lines using DataFileConverter?
Can I convert SQL to JSON lines on Linux, Mac OS?
Can I convert SQL to JSON lines in command line?

More tools for JSONL / NDJSON / LDJSON.

SQL → JSON Lines reference

Type mapping

Value kindin SQLin JSON Lines
IntINT1234 (number)
BigintBIGINT9007199254740993
DecimalDECIMAL(p,s)1234.56 (number)
FloatDOUBLE PRECISION1.234e10 (number)
TextVARCHAR(n)"text" (string)
Long textTEXT / CLOB"multi-line\ntext"
DateDATE"2026-09-18" (string)
DatetimeTIMESTAMP"2026-09-18T14:30:00Z" (string)
BinaryBLOB / BYTEA"base64:..." (string)
BooleanBOOLEAN / SMALLINTtrue / false (boolean)
JSONJSON / TEXTnested object on the same line

Dialect differences

Both SQL and JSON Lines are file formats, so what differs below is how each one chooses to represent a value.

Propertyin SQLin JSON Lines
identifiersTwo competing conventions: single-quoted literals and diale...Double quotes; backslash escapes (a newline inside a string...
datesDepends on the dialect: DATE literals, TO_DATE(), or plain ...No date type: dates arrive as strings
binaryDialect-specific: X-quoted literal, 0x hex, or decode()Not supported natively - base64 inside a string
separatorStatement terminators (;)Newline between records
encodingNo declarationUTF-8 by definition
typingTypes belong to the target database, and they differ betwee...Same as JSON, but records cannot nest across lines
shapeStatements; a dump usually means CREATE TABLE plus INSERT rowsFlat stream
ceilingNo formal limit, but a single INSERT statement has to fit i...Streams, so it scales past what a single JSON document can ...

Data File Converter without the manual work

For batch jobs, large files and scheduling use the Data File Converter converter — an offline desktop app for Windows, Linux and macOS. Free trial.


Posted

in

by