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>

Open (or create) the database at path and enable foreign keys.

Source

pub fn ensure_schema(&self) -> Result<()>

Create tables and indexes if they do not yet exist, and apply any additive migrations needed for older databases.

Source

pub fn seed_projects(&self) -> Result<()>

Insert the Bitcoin Core project row if not already present.

Source

pub fn get_bitcoin_core_project_id(&self) -> Result<i64>

Return the id of the Bitcoin Core project row.

Source

pub fn create_run( &self, project_id: i64, commit_hash: &str, tool_version: &str, pr_number: Option<u32>, config_json: Option<&str>, ) -> Result<i64>

Create a new run row and return its id.

Source

pub fn insert_mutant_batch( &mut self, run_id: i64, mutants: &[MutantData], ) -> Result<()>

Batch-insert mutants under run_id using a single transaction. Duplicates (same run_id + patch_hash) are silently ignored.

Source

pub fn get_mutants_for_run( &self, run_id: i64, file_path: Option<&str>, survivors_only: bool, ) -> Result<Vec<MutantRow>>

Return mutants belonging to run_id, optionally filtered by file_path. When survivors_only is true, only mutants with status 'survived' are returned.

Source

pub fn update_mutant_status( &self, id: i64, status: &str, command: &str, ) -> Result<()>

Update the status and command_to_test for a single mutant.

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