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

Method list_draft_chunks

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

Source from the content-addressed store, hash-verified

702 }
703
704 pub async fn list_draft_chunks(
705 &self,
706 sandbox_id: &str,
707 status_filter: Option<&str>,
708 ) -> PersistenceResult<Vec<DraftChunkRecord>> {
709 let rows = if let Some(status) = status_filter {
710 sqlx::query(
711 r#"
712SELECT "id", "scope", "status", "hit_count", "payload", "created_at_ms", "updated_at_ms"
713FROM "objects"
714WHERE "object_type" = ?1 AND "scope" = ?2 AND "status" = ?3
715ORDER BY "created_at_ms" DESC
716"#,
717 )
718 .bind(DRAFT_CHUNK_OBJECT_TYPE)
719 .bind(sandbox_id)
720 .bind(status)
721 .fetch_all(&self.pool)
722 .await
723 } else {
724 sqlx::query(
725 r#"
726SELECT "id", "scope", "status", "hit_count", "payload", "created_at_ms", "updated_at_ms"
727FROM "objects"
728WHERE "object_type" = ?1 AND "scope" = ?2
729ORDER BY "created_at_ms" DESC
730"#,
731 )
732 .bind(DRAFT_CHUNK_OBJECT_TYPE)
733 .bind(sandbox_id)
734 .fetch_all(&self.pool)
735 .await
736 }
737 .map_err(|e| map_db_error(&e))?;
738
739 rows.into_iter().map(row_to_draft_chunk_record).collect()
740 }
741
742 pub async fn update_draft_chunk_status(
743 &self,

Calls 1

map_db_errorFunction · 0.85

Tested by

no test coverage detected