Skip to content

extension

4 functions / 0 types

Index

FunctionDescription
loadCompile an uploaded WebAssembly component and return its extension ID.
resetInterrupt an active run. The next run starts in a fresh sandbox.
runExecute an extension in a fresh sandbox and wait for its exported run() to finish.
unloadInterrupt an active run and discard the compiled extension. Its ID becomes invalid.

load

def load(*, component: bytes, _transaction_id: str | None = None) -> str

Compile an uploaded WebAssembly component and return its extension ID.

Requires extension access at startup. Accepts up to 32 MiB and stores at most 32 extensions.

Returns str.

component : bytes

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

reset

def reset(*, id: str, _transaction_id: str | None = None) -> None

Interrupt an active run. The next run starts in a fresh sandbox.

Returns None.

id : str

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

run

def run(*, id: str, _transaction_id: str | None = None) -> None

Execute an extension in a fresh sandbox and wait for its exported run() to finish.

Concurrent runs of one ID fail. Reset or unload interrupts a run. Execution errors propagate to the caller. Statements already applied by an interrupted run are not rolled back. At most four extensions can run simultaneously. Runs have a 30 second deadline. Host filesystem, environment, network, and stdin access are unavailable. The component can still submit engine statements.

Returns None.

id : str

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

unload

def unload(*, id: str, _transaction_id: str | None = None) -> None

Interrupt an active run and discard the compiled extension. Its ID becomes invalid.

Returns None.

id : str

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.