MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / handle_test_command

Method handle_test_command

src/expr-test-util/src/lib.rs:143–156  ·  view source on GitHub ↗

Handles instructions to modify the catalog. Currently supported commands: `(defsource [types_of_cols] [[optional_sets_of_key_cols]])` - insert a source into the catalog.

(&mut self, spec: &str)

Source from the content-addressed store, hash-verified

141 /// * `(defsource [types_of_cols] [[optional_sets_of_key_cols]])` -
142 /// insert a source into the catalog.
143 pub fn handle_test_command(&mut self, spec: &str) -> Result<(), String> {
144 let mut stream_iter = tokenize(spec)?.into_iter();
145 while let Some(command) = deserialize_optional_generic::<TestCatalogCommand, _>(
146 &mut stream_iter,
147 "TestCatalogCommand",
148 )? {
149 match command {
150 TestCatalogCommand::Defsource { name, typ } => {
151 self.insert(&name, typ, false)?;
152 }
153 }
154 }
155 Ok(())
156 }
157
158 /// Clears all transient objects from the catalog.
159 pub fn remove_transient_objects(&mut self) {

Callers 3

roundtrip_with_catalogFunction · 0.80
run_roundtrip_testsFunction · 0.80
runFunction · 0.80

Calls 3

tokenizeFunction · 0.50
into_iterMethod · 0.45
insertMethod · 0.45

Tested by 3

roundtrip_with_catalogFunction · 0.64
run_roundtrip_testsFunction · 0.64
runFunction · 0.64