Search

Search IconIcon to open search

DuckDB with Obsidian

Last updatedUpdated: by Simon Späti · CreatedCreated: · 2 min read

Obsidian-duckdb-motherduck is a plugin for Obsidian that works similarly to Obsidian Dataview, but with SQL.

It can run arbitrary data with SQL, as DuckDB supports almost any format, you could query local CSVs, XML, or anything else. But not only local files work, but also remote files via DuckDB’s Extensions such as HTTP(S), Huggin Face with hf: or anything else.

How it looks inside Obsidian:

# Features

# Freeze

Cool thing, you can freeze the output, to show up and keep in your notes, so no need to run again. But you can also set it to auto refresh.

This is also really nicely implemented, as it’s just plain markdown added back to the note. Meaning if I publish this on my Public Second Brain with Quartz, it will show as well, as seen below examples.

# Examples

# Example DuckDB query

Query remote parquet file - and free in-line:

1
2
3
4
5
6
7
SELECT
  o_orderpriority AS priority,
  count(*) AS orders,
  round(sum(o_totalprice), 2) AS revenue
FROM read_parquet('https://shell.duckdb.org/data/tpch/0_01/parquet/orders.parquet')
GROUP BY 1
ORDER BY revenue DESC
priority orders revenue
2-HIGH 3065 434187711.87
4-NOT SPECIFIED 3024 428175171.06
1-URGENT 3020 426348805.57
5-LOW 2950 423182674.56
3-MEDIUM 2941 415502466.96

# MotherDuck Bluesky DB

Top authors on Bluesky:

1
2
3
4
5
SELECT author, COUNT(*) as post_count 
FROM bsky.posts 
GROUP BY author 
ORDER BY post_count DESC
LIMIT 10;
author post_count
victorsothervector.bsky.social 49
randyau.com 33
nicologiso.com 27
darraghmurray.bsky.social 25
christiannolan.bsky.social 22
pelayoarbues.com 18
hcoyote.bsky.social 17
shagility.com 17
rmoff.net 16
davidasboth.com 15

# Further Reads


Origin: GitHub - motherduckdb/obsidian-duckdb-motherduck: Obsidian Plugin for DuckDB & MotherDuck · GitHub