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

Method list_by_scope

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

Source from the content-addressed store, hash-verified

369 }
370
371 pub async fn list_by_scope(
372 &self,
373 object_type: &str,
374 scope: &str,
375 limit: u32,
376 offset: u32,
377 ) -> PersistenceResult<Vec<ObjectRecord>> {
378 let rows = sqlx::query(
379 r"
380SELECT object_type, id, name, payload, created_at_ms, updated_at_ms, labels
381FROM objects
382WHERE object_type = $1 AND scope = $2
383ORDER BY created_at_ms ASC, name ASC
384LIMIT $3 OFFSET $4
385",
386 )
387 .bind(object_type)
388 .bind(scope)
389 .bind(i64::from(limit))
390 .bind(i64::from(offset))
391 .fetch_all(&self.pool)
392 .await
393 .map_err(|e| map_db_error(&e))?;
394
395 Ok(rows.into_iter().map(row_to_object_record).collect())
396 }
397
398 pub async fn list_with_selector(
399 &self,

Callers

nothing calls this directly

Calls 1

map_db_errorFunction · 0.85

Tested by

no test coverage detected