Skip to content

Extension Loading - tracking issue #1202

@carlopi

Description

@carlopi

We have put up a very experimental deployment at https://shellwip.duckdb.org/ that include experimental loading of extensions.

The idea is https://shell.duckdb.org/ is the stable and recommended deployment, but shellwip can be used over time to gather feedback and iterate on new features.

WARNING: Do not rely on any shellwip behaviour, and use it at your own risk!

Extensions in DuckDB

Extensions are a powerful addition to DuckDB, there are a few in-tree (as in, they are opt-in but code lives in the main duckdb/duckdb repo), then over time DuckDB Labs rolled out a few others (eg sqlite_scanner), and now an extension-template is out to facilitate anyone to build their own custom extension.

Extensions in DuckDB-Wasm

DuckDB-Wasm is currenlty deliver with a predefined set of in-tree extensions loaded by default, but we want to add runtime loading of generic extensions.

Currently live in shellwip there is a custom build of duckdb-wasm that allows loading of extensions, both via name or providing an URL.

duckdb> LOAD icu;
duckdb> LOAD "https://raw.githubusercontent.com/duckdb/duckdb-wasm-wip/main/static/assets/eh/extensions/json.extension.wasm";

Here (https://github.com/duckdb/duckdb-wasm-wip#readme) there are some additional explanations, missing features, some instructions and table with updated status for the various extensions (does it compile? does it work?).

Proper testing has NOT been performed (yet), and based on the feedback we might end up changing completely some aspects, but we hope that putting this out is a first big step in having down the line full support for extensions in duckdb-wasm.

Feedback wanted!

It would be wonderful if you could have a look, try some things, and give feedback (here, in a separate issue or Discord).

Some open issues where feedback are especially relevant are:

How this should be deployed by duckdb-wasm embedders
  • should settings be system wide, like any file in './some/relative/path/extensions' could be loaded
  • should there be the possibility of more fine grained per-session limitations
  • ...
  • JavaScript API
  • batch loading of extensions
  • registering callbacks to be provided on loading?
  • registering custom JS extension loader? (say a function that given a name, either returns the Wasm-backed array buffer OR null via arbitrary logic)
  • ...
  • Compatibility across toolchains [Rust?] Currently Emscripten C/C++ toolchain is required for building extensions, and there are questions on how much flexibility there is across different compilers/tooling versions.

    Rust Wasm extensions support would be great, there are some ideas on how to make this work via C-wrapper, but work is needed.

    Thanks! -> https://shellwip.duckdb.org/

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      No labels
      No labels

      Type

      No type

      Projects

      No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions