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

Function run_for_testing

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

Short-cut for simplify test execution

(db: &Arc<RelationalDB>, sql_text: &str)

Source from the content-addressed store, hash-verified

245
246 /// Short-cut for simplify test execution
247 pub(crate) fn run_for_testing(db: &Arc<RelationalDB>, sql_text: &str) -> Result<Vec<ProductValue>, DBError> {
248 let (subs, runtime) = ModuleSubscriptions::for_test_new_runtime(db.clone());
249 runtime
250 .block_on(run(
251 db.clone(),
252 sql_text.to_string(),
253 AuthCtx::for_testing(),
254 Some(subs),
255 None,
256 &mut vec![],
257 ))
258 .map(|x| x.rows)
259 }
260
261 #[derive(Clone, Debug, Default, Eq, PartialEq)]
262 struct TestRows {

Callers 15

test_select_starFunction · 0.85
test_limitFunction · 0.85
test_countFunction · 0.85
test_sender_paramFunction · 0.85
test_select_star_tableFunction · 0.85
test_select_catalogFunction · 0.85
test_select_columnFunction · 0.85
test_whereFunction · 0.85
test_orFunction · 0.85
test_nestedFunction · 0.85
test_inner_joinFunction · 0.85

Calls 5

runFunction · 0.70
cloneMethod · 0.45
mapMethod · 0.45
block_onMethod · 0.45
to_stringMethod · 0.45

Tested by 15

test_select_starFunction · 0.68
test_limitFunction · 0.68
test_countFunction · 0.68
test_sender_paramFunction · 0.68
test_select_star_tableFunction · 0.68
test_select_catalogFunction · 0.68
test_select_columnFunction · 0.68
test_whereFunction · 0.68
test_orFunction · 0.68
test_nestedFunction · 0.68
test_inner_joinFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…