How to Output Query Results as JSON in the DuckDB CLI

DuckDB is a lightweight, fast database management system designed for analytics and embedded use cases. Its versatility makes it an excellent choice for developers and data analysts.

One useful feature of DuckDB is the ability to output query results in different formats, such as JSON, directly from the command-line interface (CLI). By default, the DuckDB CLI uses the duckbox output mode for query results (which outputs the results in a table-like format), but we can change that.

In this article, we’ll walk through the steps to output query results as JSON when using the DuckDB CLI.

Continue reading

What is NDJSON?

Newline Delimited JSON (NDJSON) is a specialized data format that provides a simple yet powerful way to handle streaming JSON data. While standard JSON is excellent for representing structured data, NDJSON addresses specific use cases where processing large datasets and streaming data is required.

This article takes a quick look at NDJSON and how it differs from regular JSON.

Continue reading

What is JSON?

JavaScript Object Notation, commonly known as JSON, is a lightweight, text-based data interchange format that has become one of the most widely used standards for transmitting data across the internet.

Despite its origins in JavaScript, JSON has evolved into a language-independent format, making it an essential tool for developers working with any programming language or platform.

Continue reading