SqliteStorage

Struct SqliteStorage 

Source
pub struct SqliteStorage { /* private fields */ }
Expand description

SQLite-based storage implementation.

Implementations§

Source§

impl SqliteStorage

Source

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

Open or create a SQLite database at the given path.

Source

pub fn in_memory() -> Result<Self>

Create an in-memory SQLite database.

Trait Implementations§

Source§

impl Storage for SqliteStorage

Source§

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

Create a new issue.
Source§

fn create_issues(&self, issues: &[Issue]) -> Result<()>

Create multiple issues in a batch.
Source§

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

Get an issue by ID.
Source§

fn get_issue_by_external_ref(&self, external_ref: &str) -> Result<Option<Issue>>

Get an issue by external reference.
Source§

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

Update an existing issue.
Source§

fn close_issue(&self, id: &str, actor: &str, reason: Option<&str>) -> Result<()>

Close an issue.
Source§

fn delete_issue( &self, id: &str, actor: &str, reason: Option<&str>, ) -> Result<()>

Soft-delete an issue (tombstone).
Source§

fn search_issues(&self, filter: &IssueFilter) -> Result<Vec<Issue>>

Search issues with filters.
Source§

fn add_dependency(&self, dep: &Dependency) -> Result<()>

Add a dependency between issues.
Source§

fn remove_dependency(&self, issue_id: &str, depends_on_id: &str) -> Result<()>

Remove a dependency between issues.
Source§

fn get_dependencies(&self, issue_id: &str) -> Result<Vec<Dependency>>

Get all dependencies for an issue (issues this one depends on).
Source§

fn get_dependents(&self, issue_id: &str) -> Result<Vec<Dependency>>

Get all dependents of an issue (issues that depend on this one).
Source§

fn would_create_cycle( &self, from_id: &str, to_id: &str, dep_type: DependencyType, ) -> Result<bool>

Check if adding a dependency would create a cycle.
Source§

fn get_ready_work(&self) -> Result<Vec<Issue>>

Get all issues that are ready for work (open, no blocking dependencies).
Source§

fn get_blocked_issues(&self) -> Result<Vec<BlockedIssue>>

Get all blocked issues with their blocking counts.
Source§

fn is_blocked(&self, issue_id: &str) -> Result<bool>

Check if an issue is blocked.
Source§

fn add_label(&self, issue_id: &str, label: &str) -> Result<()>

Add a label to an issue.
Source§

fn remove_label(&self, issue_id: &str, label: &str) -> Result<()>

Remove a label from an issue.
Source§

fn get_labels(&self, issue_id: &str) -> Result<Vec<String>>

Get all labels for an issue.
Source§

fn get_issues_by_label(&self, label: &str) -> Result<Vec<Issue>>

Get all issues with a specific label.
Source§

fn add_comment(&self, issue_id: &str, author: &str, text: &str) -> Result<i64>

Add a comment to an issue.
Source§

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

Get all comments for an issue.
Source§

fn get_events(&self, issue_id: &str) -> Result<Vec<Event>>

Get all events for an issue.
Source§

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

Set a configuration value.
Source§

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

Get a configuration value.
Source§

fn delete_config(&self, key: &str) -> Result<()>

Delete a configuration value.
Source§

fn get_all_config(&self) -> Result<HashMap<String, String>>

Get all configuration values.
Source§

fn mark_dirty(&self, issue_id: &str) -> Result<()>

Mark an issue as dirty (needs export).
Source§

fn get_dirty_issues(&self) -> Result<Vec<String>>

Get all dirty issue IDs.
Source§

fn clear_dirty(&self, issue_ids: &[String]) -> Result<()>

Clear dirty flags for specific issues.
Source§

fn get_statistics(&self) -> Result<Statistics>

Get database statistics.
Source§

fn next_child_counter(&self, parent_id: &str) -> Result<u32>

Get the next child counter for a parent issue.
Source§

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

Run a function within a transaction.
Source§

fn close(&self) -> Result<()>

Close the storage connection.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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