pub struct SqliteFileIRRepository { /* private fields */ }Expand description
SQLite-backed file IR repository.
Implementations§
Source§impl SqliteFileIRRepository
impl SqliteFileIRRepository
Sourcepub fn new(conn: Arc<Mutex<Connection>>) -> Self
pub fn new(conn: Arc<Mutex<Connection>>) -> Self
Create a new repository backed by the given connection.
Trait Implementations§
Source§impl Clone for SqliteFileIRRepository
impl Clone for SqliteFileIRRepository
Source§fn clone(&self) -> SqliteFileIRRepository
fn clone(&self) -> SqliteFileIRRepository
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SqliteFileIRRepository
impl Debug for SqliteFileIRRepository
Source§impl FileIRRepository for SqliteFileIRRepository
impl FileIRRepository for SqliteFileIRRepository
Source§fn upsert(
&self,
branch_id: &BranchId,
file: &ProjectFile,
last_commit_date: Option<i64>,
) -> Result<(), StorageError>
fn upsert( &self, branch_id: &BranchId, file: &ProjectFile, last_commit_date: Option<i64>, ) -> Result<(), StorageError>
Insert or update a file IR record. Uses
(branch_id, file_path) as the
natural key — if a row already exists, it is replaced. Read moreSource§fn upsert_with_symbol_index(
&self,
branch_id: &BranchId,
file: &ProjectFile,
last_commit_date: Option<i64>,
) -> Result<(), StorageError>
fn upsert_with_symbol_index( &self, branch_id: &BranchId, file: &ProjectFile, last_commit_date: Option<i64>, ) -> Result<(), StorageError>
Insert or update a file IR record and replace the matching
symbol_definitions / symbol_imports rows in a single transaction. Read moreSource§fn get_by_path(
&self,
branch_id: &BranchId,
file_path: &str,
) -> Result<ProjectFile, StorageError>
fn get_by_path( &self, branch_id: &BranchId, file_path: &str, ) -> Result<ProjectFile, StorageError>
Get the IR for a file by its path within a branch.
Source§fn get_by_branch(
&self,
branch_id: &BranchId,
) -> Result<Vec<ProjectFile>, StorageError>
fn get_by_branch( &self, branch_id: &BranchId, ) -> Result<Vec<ProjectFile>, StorageError>
Get all file IR records for the given branch.
Source§fn get_file_hashes_by_branch(
&self,
branch_id: &BranchId,
) -> Result<HashMap<String, String>, StorageError>
fn get_file_hashes_by_branch( &self, branch_id: &BranchId, ) -> Result<HashMap<String, String>, StorageError>
Get all
(file_path, content_hash) pairs for a branch. Read moreSource§fn delete_by_path(
&self,
branch_id: &BranchId,
file_path: &str,
) -> Result<(), StorageError>
fn delete_by_path( &self, branch_id: &BranchId, file_path: &str, ) -> Result<(), StorageError>
Delete the IR record for a file path within a branch.
Source§fn delete_with_symbol_index(
&self,
branch_id: &BranchId,
file_path: &str,
) -> Result<(), StorageError>
fn delete_with_symbol_index( &self, branch_id: &BranchId, file_path: &str, ) -> Result<(), StorageError>
Delete the
files_ir row and every matching symbol_definitions /
symbol_imports row for (branch_id, file_path) in a single
transaction. Pairs with Self::upsert_with_symbol_index so the
watcher / scanner have one atomic write path for both add/modify and
delete — readers cannot observe files_ir gone while symbol-index
rows linger (or vice versa). Read moreSource§fn check_content_hash(
&self,
branch_id: &BranchId,
file_path: &str,
content_hash: &str,
) -> Result<bool, StorageError>
fn check_content_hash( &self, branch_id: &BranchId, file_path: &str, content_hash: &str, ) -> Result<bool, StorageError>
Check whether the stored content hash matches the given hash.
Returns
true if a record exists and the hash matches, false otherwise.Auto Trait Implementations§
impl Freeze for SqliteFileIRRepository
impl RefUnwindSafe for SqliteFileIRRepository
impl Send for SqliteFileIRRepository
impl Sync for SqliteFileIRRepository
impl Unpin for SqliteFileIRRepository
impl UnsafeUnpin for SqliteFileIRRepository
impl UnwindSafe for SqliteFileIRRepository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more