extension
4 functions / 0 types
Index
| Function | Description |
|---|---|
| load | Compile an uploaded WebAssembly component and return its extension ID. |
| reset | Interrupt an active run. The next run starts in a fresh sandbox. |
| run | Execute an extension in a fresh sandbox and wait for its exported run() to finish. |
| unload | Interrupt an active run and discard the compiled extension. Its ID becomes invalid. |
load
def load(*, component: bytes, _transaction_id: str | None = None) -> strCompile 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) -> NoneInterrupt 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) -> NoneExecute 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) -> NoneInterrupt 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.