pub struct SqliteBackend { /* private fields */ }Expand description
SQLite-backed graph store.
Implementations§
Source§impl SqliteBackend
impl SqliteBackend
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self, SqliteError>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, SqliteError>
Open or create a SQLite graph database.
Sourcepub fn persist_scan(
&mut self,
targets: &[Target],
findings: &[Finding],
) -> Result<(), SqliteError>
pub fn persist_scan( &mut self, targets: &[Target], findings: &[Finding], ) -> Result<(), SqliteError>
Persist a scan of targets and findings, inferring edges.
Sourcepub fn compute_diff(
&self,
targets: &[Target],
findings: &[Finding],
removed_threshold: Duration,
) -> Result<ScanDiff, SqliteError>
pub fn compute_diff( &self, targets: &[Target], findings: &[Finding], removed_threshold: Duration, ) -> Result<ScanDiff, SqliteError>
Compute temporal diff.
Sourcepub fn conn(&self) -> &Connection
pub fn conn(&self) -> &Connection
Raw SQL escape hatch for advanced queries.
Trait Implementations§
Source§impl GraphBackend for SqliteBackend
impl GraphBackend for SqliteBackend
Source§type Error = SqliteError
type Error = SqliteError
Error type returned by this backend.
Source§fn init(&mut self) -> Result<(), Self::Error>
fn init(&mut self) -> Result<(), Self::Error>
Initialize the backend (create tables/files, run migrations).
Source§fn write_nodes(&mut self, nodes: &[Node]) -> Result<(), Self::Error>
fn write_nodes(&mut self, nodes: &[Node]) -> Result<(), Self::Error>
Persist a batch of nodes.
Source§fn write_edges(&mut self, edges: &[Edge]) -> Result<(), Self::Error>
fn write_edges(&mut self, edges: &[Edge]) -> Result<(), Self::Error>
Persist a batch of edges.
Source§fn find_nodes_by_type(&self, kind: NodeType) -> Result<Vec<Node>, Self::Error>
fn find_nodes_by_type(&self, kind: NodeType) -> Result<Vec<Node>, Self::Error>
Find nodes by type.
Auto Trait Implementations§
impl !Freeze for SqliteBackend
impl !RefUnwindSafe for SqliteBackend
impl Send for SqliteBackend
impl !Sync for SqliteBackend
impl Unpin for SqliteBackend
impl UnsafeUnpin for SqliteBackend
impl !UnwindSafe for SqliteBackend
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