Skip to main content

Connection

Struct Connection 

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

A connection-scoped backend-neutral datastore handle.

Implementations§

Source§

impl Connection

Source

pub fn open(route: DatastoreRoute) -> Result<Self, DactylError>

Open a route with the default policy.

Source

pub fn open_with_options( _route: DatastoreRoute, _options: ConnectionOptions, ) -> Result<Self, DactylError>

Keep the crate’s no-feature build useful for analysis-only consumers.

Source

pub fn from_env() -> Result<Self, DactylError>

Open the active environment-selected route.

Source

pub fn datastore(&self) -> Datastore

Source

pub fn dialect(&self) -> Dialect

Source

pub fn route(&self) -> &DatastoreRoute

Source

pub fn options(&self) -> &ConnectionOptions

Source

pub fn query( &self, sql: &str, params: &[Parameter], ) -> Result<Rows, DactylError>

Execute a query or write and return its projected rows.

Source

pub fn execute( &self, sql: &str, params: &[Parameter], ) -> Result<u64, DactylError>

Execute one DDL/migration/affected-row statement.

Source

pub fn execute_batch(&self, sql: &str) -> Result<(), DactylError>

Execute a caller-owned SQL script containing multiple statements.

Source

pub fn transaction( &self, statements: &[Statement], ) -> Result<Vec<Rows>, DactylError>

Execute an all-or-nothing batch of parameterized statements.

Source

pub fn last_insert_id(&self) -> Result<i64, DactylError>

Return the adapter’s last generated insert id when available.

Source

pub fn execute_op(&self, op: StorageOp) -> Result<StorageResult, DactylError>

Execute the operation-based thin-waist contract used by callers that must support both local and remote storage without closure types tied to SQLite.

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.