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

Method list_by_scope

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

Source from the content-addressed store, hash-verified

395 }
396
397 pub async fn list_by_scope(
398 &self,
399 object_type: &str,
400 scope: &str,
401 limit: u32,
402 offset: u32,
403 ) -> PersistenceResult<Vec<ObjectRecord>> {
404 let rows = sqlx::query(
405 r#"
406SELECT "object_type", "id", "name", "payload", "created_at_ms", "updated_at_ms", "labels"
407FROM "objects"
408WHERE "object_type" = ?1 AND "scope" = ?2
409ORDER BY "created_at_ms" ASC, "name" ASC
410LIMIT ?3 OFFSET ?4
411"#,
412 )
413 .bind(object_type)
414 .bind(scope)
415 .bind(i64::from(limit))
416 .bind(i64::from(offset))
417 .fetch_all(&self.pool)
418 .await
419 .map_err(|e| map_db_error(&e))?;
420
421 Ok(rows.into_iter().map(row_to_object_record).collect())
422 }
423 pub async fn list_with_selector(
424 &self,
425 object_type: &str,

Callers

nothing calls this directly

Calls 1

map_db_errorFunction · 0.85

Tested by

no test coverage detected