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

Method list_draft_chunks

crates/openshell-server/src/persistence/postgres.rs:682–718  ·  view source on GitHub ↗
(
        &self,
        sandbox_id: &str,
        status_filter: Option<&str>,
    )

Source from the content-addressed store, hash-verified

680 }
681
682 pub async fn list_draft_chunks(
683 &self,
684 sandbox_id: &str,
685 status_filter: Option<&str>,
686 ) -> PersistenceResult<Vec<DraftChunkRecord>> {
687 let rows = if let Some(status) = status_filter {
688 sqlx::query(
689 r"
690SELECT id, scope, status, hit_count, payload, created_at_ms, updated_at_ms
691FROM objects
692WHERE object_type = $1 AND scope = $2 AND status = $3
693ORDER BY created_at_ms DESC
694",
695 )
696 .bind(DRAFT_CHUNK_OBJECT_TYPE)
697 .bind(sandbox_id)
698 .bind(status)
699 .fetch_all(&self.pool)
700 .await
701 } else {
702 sqlx::query(
703 r"
704SELECT id, scope, status, hit_count, payload, created_at_ms, updated_at_ms
705FROM objects
706WHERE object_type = $1 AND scope = $2
707ORDER BY created_at_ms DESC
708",
709 )
710 .bind(DRAFT_CHUNK_OBJECT_TYPE)
711 .bind(sandbox_id)
712 .fetch_all(&self.pool)
713 .await
714 }
715 .map_err(|e| map_db_error(&e))?;
716
717 rows.into_iter().map(row_to_draft_chunk_record).collect()
718 }
719
720 pub async fn update_draft_chunk_status(
721 &self,

Callers

nothing calls this directly

Calls 1

map_db_errorFunction · 0.85

Tested by

no test coverage detected