Struct Sqlite

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

A connector interface for the SQLite database

Implementations§

Source§

impl Sqlite

Source

pub fn new(file_path: &str) -> Result<Sqlite>

Source

pub fn attach_database(&mut self, db_name: &str) -> Result<()>

Trait Implementations§

Source§

impl Queryable for Sqlite

Source§

fn execute<'a>(&'a self, q: Query<'a>) -> DBIO<'a, Option<Id>>

Executes the given query and returns the ID of the last inserted row.
Source§

fn query<'a>(&'a self, q: Query<'a>) -> DBIO<'a, ResultSet>

Executes the given query and returns the result set.
Source§

fn query_raw<'a>( &'a self, sql: &'a str, params: &'a [ParameterizedValue<'_>], ) -> DBIO<'a, ResultSet>

Executes a query given as SQL, interpolating the given parameters and returning a set of results.
Source§

fn execute_raw<'a>( &'a self, sql: &'a str, params: &'a [ParameterizedValue<'_>], ) -> DBIO<'a, u64>

Executes a query given as SQL, interpolating the given parameters and returning the number of affected rows.
Source§

fn raw_cmd<'a>(&'a self, cmd: &'a str) -> DBIO<'a, ()>

Runs a command in the database, for queries that can’t be run using prepared statements.
Source§

fn select<'a>(&'a self, q: Select<'a>) -> DBIO<'a, ResultSet>

Source§

fn insert<'a>(&'a self, q: Insert<'a>) -> DBIO<'a, Option<Id>>

For inserting data. Returns the ID of the last inserted row.
Source§

fn update<'a>(&'a self, q: Update<'a>) -> DBIO<'a, ()>

For updating data.
Source§

fn delete<'a>(&'a self, q: Delete<'a>) -> DBIO<'a, ()>

For deleting data.
Source§

impl TransactionCapable for Sqlite

Source§

fn start_transaction(&self) -> DBIO<'_, Transaction<'_>>

Starts a new transaction
Source§

impl TryFrom<&str> for Sqlite

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(path: &str) -> Result<Self>

Performs the conversion.

Auto Trait Implementations§

§

impl !Freeze for Sqlite

§

impl RefUnwindSafe for Sqlite

§

impl Send for Sqlite

§

impl Sync for Sqlite

§

impl Unpin for Sqlite

§

impl UnwindSafe for Sqlite

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,