DuckDB.mojo

A 🔥 client for DuckDB

Sören Brunk

2024-08-12

DuckDB is a fast in-process analytical database

Existing Client APIs

  • DuckDB is written in C++
  • CLI and client APIs for many languages
  • Good integration with the Python data ecosystem (Pandas, PyArrow etc.)

Why a native Mojo client?

🔥
❤️‍🔥

  • Best Integration with the language, types and native data structures
  • Improve performance & control over memory
  • No dependency on Python
  • Great opportunity to learn Mojo 😀

Demo

https://github.com/sbrunk/duckdb.mojo/blob/main/example.ipynb

Current Implementation

Low Level C Bindings

Manually translated to Mojo structs & FFI calls

Higher Level Mojo API

Typed Results

Typed Results

 

What’s next?

  • Support all DuckDB types
  • Improve API/simplify implementation as the language evolves
  • Contributions welcome!

Q&A / Discussion


https://github.com/sbrunk/duckdb.mojo


https://duckdb.org/