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

Method get

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

Source from the content-addressed store, hash-verified

282 }
283
284 pub async fn get(
285 &self,
286 object_type: &str,
287 id: &str,
288 ) -> PersistenceResult<Option<ObjectRecord>> {
289 let row = sqlx::query(
290 r"
291SELECT object_type, id, name, payload, created_at_ms, updated_at_ms, labels, resource_version
292FROM objects
293WHERE object_type = $1 AND id = $2
294",
295 )
296 .bind(object_type)
297 .bind(id)
298 .fetch_optional(&self.pool)
299 .await
300 .map_err(|e| map_db_error(&e))?;
301
302 Ok(row.map(row_to_object_record))
303 }
304
305 pub async fn get_by_name(
306 &self,

Callers 6

put_ifMethod · 0.45
delete_ifMethod · 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