MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / run_with_instance

Function run_with_instance

crates/core/src/sql/execute.rs:69–78  ·  view source on GitHub ↗

Run the `SQL` string using the provided `WasmInstance` and `ModuleDef` The query will always be executed on the module's thread.

(
    instance: &mut RefInstance<I>,
    db: Arc<RelationalDB>,
    sql_text: String,
    auth: AuthCtx,
    subs: Option<ModuleSubscriptions>,
    head: &mut Vec<(RawIdentifier, AlgebraicType)>,
)

Source from the content-addressed store, hash-verified

67///
68/// The query will always be executed on the module's thread.
69pub(crate) fn run_with_instance<I: WasmInstance>(
70 instance: &mut RefInstance<I>,
71 db: Arc<RelationalDB>,
72 sql_text: String,
73 auth: AuthCtx,
74 subs: Option<ModuleSubscriptions>,
75 head: &mut Vec<(RawIdentifier, AlgebraicType)>,
76) -> Result<(SqlResult, bool), DBError> {
77 run_inner::<I>(Some(instance), db, sql_text, auth, subs, head)
78}
79
80fn run_inner<I: WasmInstance>(
81 instance: Option<&mut RefInstance<I>>,

Callers 1

handle_sql_cmdMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…