Database

Struct Database 

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

Main database struct that provides core operations in order to work with SQLite.

Trait Implementations§

Source§

impl<'a> Connection<'a> for Database

Source§

fn open<T>(db_path: T) -> Result<Self, MinSqliteWrapperError<'a>>
where Self: Sized, T: AsRef<Path>,

Opens a database and creates a new database connection. If the filename does not exist, it will be created. The file will be opened read/write if possible. If not, the file will be opened read-only. Read more
Source§

fn close(self) -> SqlitePrimaryResult

The sqlite3_close() is destructor for the sqlite3 object. Returns SqlitePrimaryResult::Ok if the sqlite3 object is successfully destroyed and all associated resources are deallocated. Read more
Source§

impl Drop for Database

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Operations for Database

Source§

fn execute<'a, F>( &self, statement: String, callback_fn: Option<F>, ) -> Result<SqlitePrimaryResult, MinSqliteWrapperError<'a>>

A wrapper around prepare(), execute_prepared(), and kill(), that allows an application to run multiple statements of SQL without having to use a lot of Rust code. Read more
Source§

fn prepare<'a, F>( &self, statement: String, callback_fn: Option<F>, ) -> Result<SqlStatement, MinSqliteWrapperError<'a>>

Prepares SQL operation to be executed and then destroy. Read more
Source§

impl Send for Database

Source§

impl Sync for Database

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