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

Function test_multi_column

crates/core/src/sql/execute.rs:1395–1413  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1393
1394 #[test]
1395 fn test_multi_column() -> ResultTest<()> {
1396 let (db, _input) = create_data(1)?;
1397
1398 // Create table [test] with index on [a, b]
1399 let schema = &[
1400 ("a", AlgebraicType::I32),
1401 ("b", AlgebraicType::I32),
1402 ("c", AlgebraicType::I32),
1403 ("d", AlgebraicType::I32),
1404 ];
1405 let table_id = db.create_table_for_test_multi_column("test", schema, col_list![0, 1])?;
1406 with_auto_commit(&db, |tx| insert(&db, tx, table_id, &product![1, 1, 1, 1]).map(drop))?;
1407
1408 let result = run_for_testing(&db, "select * from test where b = 1 and a = 1")?;
1409
1410 assert_eq!(result, vec![product![1, 1, 1, 1]]);
1411
1412 Ok(())
1413 }
1414
1415 /// Test we are protected against stack overflows when:
1416 /// 1. The query is too large (too many characters)

Callers

nothing calls this directly

Calls 7

create_dataFunction · 0.85
with_auto_commitFunction · 0.85
run_for_testingFunction · 0.85
insertFunction · 0.50
OkFunction · 0.50
mapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…