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

Function test_select_catalog

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

Source from the content-addressed store, hash-verified

1109
1110 #[test]
1111 fn test_select_catalog() -> ResultTest<()> {
1112 let (db, _) = create_data(1)?;
1113
1114 let tx = begin_tx(&db);
1115 let _ = db.release_tx(tx);
1116
1117 let result = run_for_testing(
1118 &db,
1119 &format!("SELECT * FROM {ST_TABLE_NAME} WHERE table_id = {ST_TABLE_ID}"),
1120 )?;
1121
1122 let pk_col_id: ColId = StTableFields::TableId.into();
1123 let row = product![
1124 ST_TABLE_ID,
1125 ST_TABLE_NAME,
1126 StTableType::System.as_str(),
1127 StAccess::Public.as_str(),
1128 Some(AlgebraicValue::Array(ArrayValue::U16(vec![pk_col_id.0].into()))),
1129 ];
1130
1131 assert_eq!(result, vec![row], "st_table");
1132 Ok(())
1133 }
1134
1135 #[test]
1136 fn test_select_column() -> ResultTest<()> {

Callers

nothing calls this directly

Calls 5

create_dataFunction · 0.85
run_for_testingFunction · 0.85
begin_txFunction · 0.50
OkFunction · 0.50
release_txMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…