Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling extensions in the wasm build #839

Closed
david542542 opened this issue Jun 15, 2022 · 4 comments
Closed

Enabling extensions in the wasm build #839

david542542 opened this issue Jun 15, 2022 · 4 comments

Comments

@david542542
Copy link

It would be nice to be able to easily make the wasm build by including one or more extensions, such as the JSON one. And I'm sure as the project involves there will be many more practical extensions that someone might want to use, so I'll break this down into two items:

  1. It would be great to have instructions for a developer to be able to build wasm with various extensions.
  2. It would be great to show an example with the most commonly used JSON extension as an additional target.

Of course adding additional extensions will add size to the bundle, and I think the size with/without the JSON extension will show approximately how much additional size each extension will add (though it's of course highly dependent on what the extension is).

@ankoh
Copy link
Member

ankoh commented Jun 21, 2022

I experimented with this a bit a while ago, we could build an extension loading mechanism similar to native DuckDB.
Extensions would be instantiated with the heap memory of the main duckdb-wasm instance and would get the database pointer to register their extensions.
Conceptually this would work but is clearly in experimentation territory.

@ankoh
Copy link
Member

ankoh commented Jun 21, 2022

Shipping extensions by default in all of our bundles bloats the module sizes for everyone, we already did this for Parquet and FTS but we have to be a bit careful here.
Especially since duckdb-wasm already has a dedicated efficient json import.

@david542542
Copy link
Author

@ankoh cool, in terms of adding in an extension loading mechanism, how much work do you think that might involve? Seems like being in experimental territory should probably be fine, since the whole extension/plugin framework seems pretty new and all.

@srossross
Copy link

It would be great to have instructions for a developer to be able to build wasm with various extensions

I'm building an extension starting from https://github.com/duckdb/extension-template/. I am curious how to compile it to wasm - google lead me here, but I can not find other documentation, can anyone point me in the right direction?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants