Skip to main content

Database

Struct Database 

Source
pub struct Database { /* private fields */ }

Implementations§

Source§

impl Database

Source

pub fn open(path: &Path) -> Result<Self>

Source

pub fn with_conn<F, T>(&self, f: F) -> Result<T>
where F: FnOnce(&Connection) -> Result<T>,

Source

pub fn upsert_workspace( &self, id: &str, linear_org_id: Option<&str>, display_name: Option<&str>, ) -> Result<()>

Source

pub fn get_workspace(&self, id: &str) -> Result<Option<WorkspaceRow>>

Source

pub fn list_workspaces(&self) -> Result<Vec<WorkspaceRow>>

Source

pub fn delete_workspace(&self, id: &str) -> Result<usize>

Delete a workspace and all its associated data (issues, chunks, comments, sync state).

Source

pub fn upsert_issue(&self, issue: &Issue) -> Result<()>

Source

pub fn get_issue(&self, id_or_identifier: &str) -> Result<Option<Issue>>

Source

pub fn get_unprioritized_issues( &self, team_key: Option<&str>, include_completed: bool, workspace_id: &str, ) -> Result<Vec<Issue>>

Source

pub fn get_issues_by_state_types( &self, team_key: &str, state_types: &[String], workspace_id: &str, ) -> Result<Vec<Issue>>

Source

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).

Source

pub fn count_issues( &self, team_key: Option<&str>, workspace_id: &str, ) -> Result<usize>

Source

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).

Source

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.

Source

pub fn upsert_relations( &self, issue_id: &str, relations: &[Relation], ) -> Result<()>

Source

pub fn get_relations_enriched( &self, issue_id: &str, ) -> Result<Vec<EnrichedRelation>>

Source

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

Source

pub fn upsert_chunks( &self, issue_id: &str, chunks: &[(usize, String, Vec<u8>)], ) -> Result<()>

Source

pub fn upsert_chunks_with_model( &self, issue_id: &str, chunks: &[(usize, String, Vec<u8>)], model_name: &str, ) -> Result<()>

Source

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.

Source

pub fn get_all_chunks(&self, workspace_id: &str) -> Result<Vec<Chunk>>

Source

pub fn get_chunks_for_team( &self, team_key: &str, workspace_id: &str, ) -> Result<Vec<Chunk>>

Source

pub fn count_embedded_issues( &self, team_key: Option<&str>, workspace_id: &str, ) -> Result<usize>

Source

pub fn get_issues_needing_embedding( &self, team_key: Option<&str>, force: bool, workspace_id: &str, ) -> Result<Vec<Issue>>

Source

pub fn get_comments(&self, issue_id: &str) -> Result<Vec<Comment>>

Source

pub fn get_sync_cursor( &self, workspace_id: &str, team_key: &str, ) -> Result<Option<String>>

Source

pub fn set_sync_cursor( &self, workspace_id: &str, team_key: &str, last_updated_at: &str, ) -> Result<()>

Source

pub fn is_full_sync_done( &self, workspace_id: &str, team_key: &str, ) -> Result<bool>

Source

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.

Source

pub fn get_metadata(&self, key: &str) -> Result<Option<String>>

Source

pub fn set_metadata(&self, key: &str, value: &str) -> Result<()>

Source

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.

Trait Implementations§

Source§

impl Clone for Database

Source§

fn clone(&self) -> Database

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> CompatExt for T

Source§

fn compat(self) -> Compat<T>

Applies the Compat adapter by value. Read more
Source§

fn compat_ref(&self) -> Compat<&T>

Applies the Compat adapter by shared reference. Read more
Source§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the Compat adapter by mutable reference. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

Source§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
Source§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
Source§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
Source§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more