Query JSON data using DuckDB

Published on Nov 13, 2023

What is it?

DuckDB is a tool that can be used to query JSON data, with SQL. It can also do other things, head over to the DuckDB homepage to read more.

What can we do with it?

Installation

Follow the installation instructions to install.

In my case, I could install it on my MacOS with brew install duckdb.

Getting started and documentation

Read through the SQL syntax

Use the same syntax to query JSON files like so :

❯ duckdb
v0.9.1 401c8061c6
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
D select * from './worldcup.json';