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

Method list

crates/openshell-server/src/persistence/postgres.rs:346–369  ·  view source on GitHub ↗
(
        &self,
        object_type: &str,
        limit: u32,
        offset: u32,
    )

Source from the content-addressed store, hash-verified

344 }
345
346 pub async fn list(
347 &self,
348 object_type: &str,
349 limit: u32,
350 offset: u32,
351 ) -> PersistenceResult<Vec<ObjectRecord>> {
352 let rows = sqlx::query(
353 r"
354SELECT object_type, id, name, payload, created_at_ms, updated_at_ms, labels, resource_version
355FROM objects
356WHERE object_type = $1
357ORDER BY created_at_ms ASC, name ASC
358LIMIT $2 OFFSET $3
359",
360 )
361 .bind(object_type)
362 .bind(i64::from(limit))
363 .bind(i64::from(offset))
364 .fetch_all(&self.pool)
365 .await
366 .map_err(|e| map_db_error(&e))?;
367
368 Ok(rows.into_iter().map(row_to_object_record).collect())
369 }
370
371 pub async fn list_by_scope(
372 &self,

Callers

nothing calls this directly

Calls 1

map_db_errorFunction · 0.85

Tested by

no test coverage detected