pub struct Database { /* private fields */ }Implementations§
Source§impl Database
impl Database
pub fn open(path: &Path) -> Result<Self>
pub fn with_conn<F, T>(&self, f: F) -> Result<T>
pub fn upsert_workspace( &self, id: &str, linear_org_id: Option<&str>, display_name: Option<&str>, ) -> Result<()>
pub fn get_workspace(&self, id: &str) -> Result<Option<WorkspaceRow>>
pub fn list_workspaces(&self) -> Result<Vec<WorkspaceRow>>
Sourcepub fn delete_workspace(&self, id: &str) -> Result<usize>
pub fn delete_workspace(&self, id: &str) -> Result<usize>
Delete a workspace and all its associated data (issues, chunks, comments, sync state).
pub fn upsert_issue(&self, issue: &Issue) -> Result<()>
pub fn get_issue(&self, id_or_identifier: &str) -> Result<Option<Issue>>
pub fn get_unprioritized_issues( &self, team_key: Option<&str>, include_completed: bool, workspace_id: &str, ) -> Result<Vec<Issue>>
pub fn get_issues_by_state_types( &self, team_key: &str, state_types: &[String], workspace_id: &str, ) -> Result<Vec<Issue>>
Sourcepub fn get_blockers_for_issues(
&self,
issue_ids: &[String],
) -> Result<Vec<BlockerRow>>
pub fn get_blockers_for_issues( &self, issue_ids: &[String], ) -> Result<Vec<BlockerRow>>
For a set of issue IDs, return all blocked_by relations with resolved state info.
Returns (issue_id, blocker_identifier, blocker_title, blocker_state_name, blocker_state_type).
pub fn count_issues( &self, team_key: Option<&str>, workspace_id: &str, ) -> Result<usize>
Sourcepub fn get_field_completeness(
&self,
team_key: Option<&str>,
workspace_id: &str,
) -> Result<(usize, usize, usize, usize, usize)>
pub fn get_field_completeness( &self, team_key: Option<&str>, workspace_id: &str, ) -> Result<(usize, usize, usize, usize, usize)>
Count issues with each optional field populated. Returns (total, with_description, with_priority, with_labels, with_project).
Sourcepub fn list_all_issues(
&self,
team_key: Option<&str>,
filter: Option<&str>,
limit: usize,
offset: usize,
workspace_id: &str,
) -> Result<Vec<IssueSummary>>
pub fn list_all_issues( &self, team_key: Option<&str>, filter: Option<&str>, limit: usize, offset: usize, workspace_id: &str, ) -> Result<Vec<IssueSummary>>
List all issues with summary info (no description text). Supports pagination, optional team filter, and optional text filter on identifier/title.
pub fn upsert_relations( &self, issue_id: &str, relations: &[Relation], ) -> Result<()>
pub fn get_relations_enriched( &self, issue_id: &str, ) -> Result<Vec<EnrichedRelation>>
Sourcepub fn find_relation_id(
&self,
issue_id: &str,
related_issue_id: &str,
relation_type: &str,
) -> Result<Option<String>>
pub fn find_relation_id( &self, issue_id: &str, related_issue_id: &str, relation_type: &str, ) -> Result<Option<String>>
Look up a relation ID between two issues (by identifier) for deletion
pub fn upsert_chunks( &self, issue_id: &str, chunks: &[(usize, String, Vec<u8>)], ) -> Result<()>
pub fn upsert_chunks_with_model( &self, issue_id: &str, chunks: &[(usize, String, Vec<u8>)], model_name: &str, ) -> Result<()>
Sourcepub fn get_embedding_model(&self, issue_id: &str) -> Result<Option<String>>
pub fn get_embedding_model(&self, issue_id: &str) -> Result<Option<String>>
Get the embedding model name for an issue’s chunks, if any exist.
pub fn get_all_chunks(&self, workspace_id: &str) -> Result<Vec<Chunk>>
pub fn get_chunks_for_team( &self, team_key: &str, workspace_id: &str, ) -> Result<Vec<Chunk>>
pub fn count_embedded_issues( &self, team_key: Option<&str>, workspace_id: &str, ) -> Result<usize>
pub fn get_issues_needing_embedding( &self, team_key: Option<&str>, force: bool, workspace_id: &str, ) -> Result<Vec<Issue>>
pub fn get_comments(&self, issue_id: &str) -> Result<Vec<Comment>>
pub fn get_sync_cursor( &self, workspace_id: &str, team_key: &str, ) -> Result<Option<String>>
pub fn set_sync_cursor( &self, workspace_id: &str, team_key: &str, last_updated_at: &str, ) -> Result<()>
pub fn is_full_sync_done( &self, workspace_id: &str, team_key: &str, ) -> Result<bool>
Sourcepub fn get_last_synced_at(
&self,
workspace_id: &str,
team_key: &str,
) -> Result<Option<String>>
pub fn get_last_synced_at( &self, workspace_id: &str, team_key: &str, ) -> Result<Option<String>>
Get the wall-clock time of the last sync for a team.
pub fn get_metadata(&self, key: &str) -> Result<Option<String>>
pub fn set_metadata(&self, key: &str, value: &str) -> Result<()>
Sourcepub fn list_synced_teams(&self, workspace_id: &str) -> Result<Vec<TeamSummary>>
pub fn list_synced_teams(&self, workspace_id: &str) -> Result<Vec<TeamSummary>>
List teams that have synced issues, with issue and embedding counts. Local-only query — no network required.