Mosaic DuckDB Server
The Mosaic duckdb-server package provides a Python-based server that runs a local DuckDB instance and supports queries over HTTP, returning data in either Apache Arrow or JSON format.
TIP
This package provides a local DuckDB server. To instead use DuckDB-WASM in the browser, use the wasmConnector from the mosaic-core package.
INFO
DuckDB can also connect to and query other databases, such as PostgreSQL and MySQL. See the multi-database support page for examples.
Usage
The server package is available on PyPi.
We recommend running the server in an isolated environment with pipx. For example, to directly run the server, use:
pipx run duckdb-serverAlternatively, you can install the server with pip install duckdb-server. Then you can start the server with duckdb-server.
Developer Setup
For shared localhost HTTPS/HTTP/2 setup for Node, Rust, and Go, install native mkcert on PATH, then run pnpm mkcert from the repository root. See the server guide for certificate discovery and renewal.
To run the server from the Mosaic repository and to run the server in development mode, follow the instructions for the duckdb-server package.