Run the `SQL` string using the `auth` credentials If a `ModuleHost` is provided, the SQL query is executed via the module host, meaning the module’s core is used to run the statement. If no module host is provided, the SQL query is executed on the current thread.
(
db: Arc<RelationalDB>,
sql_text: String,
auth: AuthCtx,
subs: Option<ModuleSubscriptions>,
module: Option<ModuleHost>,
head: &mut Vec<(RawIdentifier, AlgebraicType)>,
)
| 50 | /// meaning the module’s core is used to run the statement. |
| 51 | /// If no module host is provided, the SQL query is executed on the current thread. |
| 52 | pub async fn run( |
| 53 | db: Arc<RelationalDB>, |
| 54 | sql_text: String, |
| 55 | auth: AuthCtx, |
| 56 | subs: Option<ModuleSubscriptions>, |
| 57 | module: Option<ModuleHost>, |
| 58 | head: &mut Vec<(RawIdentifier, AlgebraicType)>, |
| 59 | ) -> Result<SqlResult, DBError> { |
| 60 | match module { |
| 61 | Some(module) => module.call_sql(db, sql_text, auth, subs, head).await, |
| 62 | None => run_inner::<crate::host::wasmtime::WasmtimeInstance>(None, db, sql_text, auth, subs, head).map(|x| x.0), |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | /// Run the `SQL` string using the provided `WasmInstance` and `ModuleDef` |
| 67 | /// |