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

Function db_info

crates/client-api/src/routes/database.rs:592–606  ·  view source on GitHub ↗
(
    State(worker_ctx): State<S>,
    Path(DatabaseParam { name_or_identity }): Path<DatabaseParam>,
)

Source from the content-addressed store, hash-verified

590}
591
592pub async fn db_info<S: ControlStateDelegate>(
593 State(worker_ctx): State<S>,
594 Path(DatabaseParam { name_or_identity }): Path<DatabaseParam>,
595) -> axum::response::Result<impl IntoResponse> {
596 log::trace!("Trying to resolve database identity: {name_or_identity:?}");
597 let database_identity = name_or_identity.resolve(&worker_ctx).await?;
598 log::trace!("Resolved identity to: {database_identity:?}");
599 let database = worker_ctx_find_database(&worker_ctx, &database_identity)
600 .await?
601 .ok_or(NO_SUCH_DATABASE)?;
602 log::trace!("Fetched database from the worker db for database identity: {database_identity:?}");
603
604 let response = DatabaseResponse::from(database);
605 Ok(axum::Json(sats::serde::SerdeWrapper(response)))
606}
607
608#[derive(Deserialize)]
609pub struct LogsParams {

Callers

nothing calls this directly

Calls 4

worker_ctx_find_databaseFunction · 0.85
SerdeWrapperClass · 0.85
OkFunction · 0.50
resolveMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…