Skip to content

sql: CREATE WASM MODULE, CREATE FUNCTION ... LANGUAGE wasm, and DROP FUNCTION - #39796

Draft
DAlperin wants to merge 2 commits into
dov/wasm-udf-invokerfrom
dov/wasm-udf-sql
Draft

DAlperin wants to merge 2 commits into
dov/wasm-udf-invokerfrom
dov/wasm-udf-sql

Conversation

@DAlperin

Copy link
Copy Markdown
Member

The user-facing surface, behind enable_wasm_functions (off in production,
on in CI).

SQL:

  • CREATE WASM MODULE, rename, owner, grants, comments, default privileges
  • CREATE FUNCTION ... LANGUAGE wasm USING MODULE binds an export
  • DROP FUNCTION f(types)
  • functions live in their own durable namespace

Privileges:

  • the CREATEWASMMODULE system privilege to upload a module
  • USAGE on a module to bind it
  • USAGE on a function's schema to call it

Catalog and introspection:

  • catalog version 93, with additive enum variants only
  • mz_wasm_modules, and user functions in mz_functions and pg_proc
  • statement logging redacts module bytes

Checks run at sequencing, not planning, so stricter validators or lower
limits never stop a catalog from opening.

Modules are installed only on the compute instances whose dataflows or peeks
call them. Offloaded peeks pin the modules they use. environmentd validates
modules but never compiles or runs them.

Tests

  • src/environmentd/tests/wasm_udf.rs: end to end, including restart,
    validation and privileges.

Release notes

None. Behind enable_wasm_functions, which is off in production.

Generated with Claude Code

@DAlperin
DAlperin added this pull request to stack #39800 October 13, 2026 17:14

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant