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

Method with_debug

src/adapter/src/catalog.rs:323–335  ·  view source on GitHub ↗

Creates a debug catalog from the current `METADATA_BACKEND_URL` with parameters set appropriately for debug contexts, like in tests. WARNING! This function can arbitrarily fail because it does not make any effort to adjust the catalog's contents' structure or semantics to the currently running version, i.e. it does not apply any migrations. This function must not be called in production contexts

(f: F)

Source from the content-addressed store, hash-verified

321 /// [`Catalog::open`] with appropriately set configuration parameters
322 /// instead.
323 pub async fn with_debug<F, Fut, T>(f: F) -> T
324 where
325 F: FnOnce(Catalog) -> Fut,
326 Fut: Future<Output = T>,
327 {
328 let persist_client = PersistClient::new_for_tests().await;
329 let organization_id = Uuid::new_v4();
330 let bootstrap_args = test_bootstrap_args();
331 let catalog = Self::open_debug_catalog(persist_client, organization_id, &bootstrap_args)
332 .await
333 .expect("can open debug catalog");
334 f(catalog).await
335 }
336
337 /// Like [`Catalog::with_debug`], but the catalog created believes that bootstrap is still
338 /// in progress.

Callers

nothing calls this directly

Calls 2

test_bootstrap_argsFunction · 0.85
expectMethod · 0.80

Tested by

no test coverage detected