MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / get

Method get

crates/openshell-server/src/persistence/sqlite.rs:300–319  ·  view source on GitHub ↗
(
        &self,
        object_type: &str,
        id: &str,
    )

Source from the content-addressed store, hash-verified

298 }
299
300 pub async fn get(
301 &self,
302 object_type: &str,
303 id: &str,
304 ) -> PersistenceResult<Option<ObjectRecord>> {
305 let row = sqlx::query(
306 r#"
307SELECT "object_type", "id", "name", "payload", "created_at_ms", "updated_at_ms", "labels", "resource_version"
308FROM "objects"
309WHERE "object_type" = ?1 AND "id" = ?2
310"#,
311 )
312 .bind(object_type)
313 .bind(id)
314 .fetch_optional(&self.pool)
315 .await
316 .map_err(|e| map_db_error(&e))?;
317
318 Ok(row.map(row_to_object_record))
319 }
320
321 pub async fn get_by_name(
322 &self,

Callers 7

put_ifMethod · 0.45
delete_ifMethod · 0.45
list_with_selectorMethod · 0.45
get_draft_versionMethod · 0.45
row_to_object_recordFunction · 0.45
row_to_policy_recordFunction · 0.45

Calls 1

map_db_errorFunction · 0.85

Tested by

no test coverage detected