MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / delete_code_projects

Method delete_code_projects

src/global_db.rs:1599–1617  ·  view source on GitHub ↗

Removes registered code-project rows by exact project id. Dependent registry rows in `project_aliases`, `store_instances`, `graph_scopes`, and `store_artifacts` cascade through foreign keys. This only removes registry metadata; it never deletes project files or profile-sharded store files on disk.

(&self, project_ids: &[String])

Source from the content-addressed store, hash-verified

1597 /// This only removes registry metadata; it never deletes project files or
1598 /// profile-sharded store files on disk.
1599 pub async fn delete_code_projects(&self, project_ids: &[String]) -> usize {
1600 const CHUNK: usize = 256;
1601 let mut total: usize = 0;
1602 for chunk in project_ids.chunks(CHUNK) {
1603 let placeholders = vec!["?"; chunk.len()];
1604 let sql = format!(
1605 "DELETE FROM code_projects WHERE project_id IN ({})",
1606 placeholders.join(",")
1607 );
1608 let values: Vec<libsql::Value> = chunk
1609 .iter()
1610 .map(|project_id| libsql::Value::Text(project_id.clone()))
1611 .collect();
1612 if let Ok(n) = self.conn.execute(&sql, values).await {
1613 total = total.saturating_add(n as usize);
1614 }
1615 }
1616 total
1617 }
1618
1619 pub async fn search_code_projects(&self, query: &str, limit: usize) -> Vec<CodeProjectRecord> {
1620 let limit = i64::try_from(limit).unwrap_or(i64::MAX);

Calls 1

collectMethod · 0.80