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

Method list

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

Source from the content-addressed store, hash-verified

370 }
371
372 pub async fn list(
373 &self,
374 object_type: &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", "resource_version"
381FROM "objects"
382WHERE "object_type" = ?1
383ORDER BY "created_at_ms" ASC, "name" ASC
384LIMIT ?2 OFFSET ?3
385"#,
386 )
387 .bind(object_type)
388 .bind(i64::from(limit))
389 .bind(i64::from(offset))
390 .fetch_all(&self.pool)
391 .await
392 .map_err(|e| map_db_error(&e))?;
393
394 Ok(rows.into_iter().map(row_to_object_record).collect())
395 }
396
397 pub async fn list_by_scope(
398 &self,

Callers 1

list_with_selectorMethod · 0.45

Calls 1

map_db_errorFunction · 0.85

Tested by

no test coverage detected