Skip to main content
vsql_duckdb runs DuckDB inside the server process, so a SQL statement can read Parquet, CSV, and JSON files straight from object storage or disk. Analytical files stay where they are, and you query them beside your tables without an export step or a second engine to operate.
This extension declares two preview capabilities, so the server must be started with --vsql_allow_preview_extensions=ON. It also needs a VillageSQL server newer than 0.0.6.

Install

vsql_duckdb is not bundled with the server, so build it from the repository first and copy the resulting vsql_duckdb.veb into the directory named by the veb_dir system variable. Then install it:
Confirm it is there:
The build instructions are in the repository.

What it adds

Example

Ask it what it is:
Run a query that touches no files:
Read a CSV and get the rows back as JSON. Reading from the server’s own disk is off by default, so turn it on first:
Turn it off again when you are done, because it stays on until you do:
Because the result is JSON, JSON_TABLE turns it back into rows you can join against your own tables.
allow_local_files opens every file the server account can read, and enable_external_access is on by default, so a query can also reach the network. Extension functions are not grantable the way stored functions are, so anyone who can run SQL here can call them: installing the extension gives every account the reach of both switches. The object storage secret lives in the keyring, and vsql_duckdb.s3_secret_keyring_id only names it.
A setting written with SET PERSIST survives a restart, but UNINSTALL EXTENSION deletes it. After an uninstall and reinstall every setting is back at its default, and no restart brings the old value back.

See also