pub struct Connection { /* private fields */ }Expand description
A connection-scoped backend-neutral datastore handle.
Implementations§
Source§impl Connection
impl Connection
Sourcepub fn open(route: DatastoreRoute) -> Result<Self, DactylError>
pub fn open(route: DatastoreRoute) -> Result<Self, DactylError>
Open a route with the default policy.
Sourcepub fn open_with_options(
_route: DatastoreRoute,
_options: ConnectionOptions,
) -> Result<Self, DactylError>
pub fn open_with_options( _route: DatastoreRoute, _options: ConnectionOptions, ) -> Result<Self, DactylError>
Keep the crate’s no-feature build useful for analysis-only consumers.
Sourcepub fn from_env() -> Result<Self, DactylError>
pub fn from_env() -> Result<Self, DactylError>
Open the active environment-selected route.
pub fn datastore(&self) -> Datastore
pub fn dialect(&self) -> Dialect
pub fn route(&self) -> &DatastoreRoute
pub fn options(&self) -> &ConnectionOptions
Sourcepub fn query(
&self,
sql: &str,
params: &[Parameter],
) -> Result<Rows, DactylError>
pub fn query( &self, sql: &str, params: &[Parameter], ) -> Result<Rows, DactylError>
Execute a query or write and return its projected rows.
Sourcepub fn execute(
&self,
sql: &str,
params: &[Parameter],
) -> Result<u64, DactylError>
pub fn execute( &self, sql: &str, params: &[Parameter], ) -> Result<u64, DactylError>
Execute one DDL/migration/affected-row statement.
Sourcepub fn execute_batch(&self, sql: &str) -> Result<(), DactylError>
pub fn execute_batch(&self, sql: &str) -> Result<(), DactylError>
Execute a caller-owned SQL script containing multiple statements.
Sourcepub fn transaction(
&self,
statements: &[Statement],
) -> Result<Vec<Rows>, DactylError>
pub fn transaction( &self, statements: &[Statement], ) -> Result<Vec<Rows>, DactylError>
Execute an all-or-nothing batch of parameterized statements.
Sourcepub fn last_insert_id(&self) -> Result<i64, DactylError>
pub fn last_insert_id(&self) -> Result<i64, DactylError>
Return the adapter’s last generated insert id when available.
Sourcepub fn execute_op(&self, op: StorageOp) -> Result<StorageResult, DactylError>
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§
impl !RefUnwindSafe for Connection
impl !UnwindSafe for Connection
impl Freeze for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnsafeUnpin for Connection
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