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

Function run

crates/pg/src/encoder.rs:179–194  ·  view source on GitHub ↗
(schema: ProductType, row: ProductValue)

Source from the content-addressed store, hash-verified

177 use spacetimedb_lib::{ConnectionId, Identity};
178
179 async fn run(schema: ProductType, row: ProductValue) -> String {
180 let header = row_desc(&schema, &Format::UnifiedText);
181
182 let stmt = SqlStmtResult {
183 schema,
184 rows: vec![row],
185 total_duration_micros: 0,
186 stats: Default::default(),
187 };
188 let mut stream = to_rows(stmt, header).unwrap();
189 let mut result = String::new();
190 if let Some(row) = stream.next().await {
191 result = String::from_utf8_lossy(row.unwrap().data.freeze().as_ref()).to_string();
192 }
193 result
194 }
195
196 #[tokio::test]
197 async fn test_primitives() {

Callers 3

test_primitivesFunction · 0.70
test_enumFunction · 0.70
test_special_typesFunction · 0.70

Calls 7

row_descFunction · 0.85
to_rowsFunction · 0.85
newFunction · 0.50
unwrapMethod · 0.45
nextMethod · 0.45
to_stringMethod · 0.45
as_refMethod · 0.45

Tested by 3

test_primitivesFunction · 0.56
test_enumFunction · 0.56
test_special_typesFunction · 0.56