pub struct Connection { /* private fields */ }Expand description
A route-scoped application driver. Backend handles remain private.
Implementations§
Source§impl Connection
impl Connection
pub fn open(route: DatastoreRoute) -> Result<Self, DactylError>
pub fn open_with_options( route: DatastoreRoute, options: OpenOptions, ) -> Result<Self, DactylError>
Sourcepub fn open_with_context(
route: DatastoreRoute,
context: Option<StorageContext>,
) -> Result<Self, DactylError>
pub fn open_with_context( route: DatastoreRoute, context: Option<StorageContext>, ) -> Result<Self, DactylError>
Open a route with an optional caller-owned storage context.
Local routes ignore the context. Neon routes require it for every operation and forward it without interpreting its payload.
pub fn open_with_options_and_context( route: DatastoreRoute, options: OpenOptions, context: Option<StorageContext>, ) -> Result<Self, DactylError>
pub fn from_env() -> Result<Self, DactylError>
pub fn datastore(&self) -> Datastore
pub fn route(&self) -> &DatastoreRoute
pub fn context(&self) -> Option<&StorageContext>
Sourcepub fn read(&self, sql: &str, params: &[Parameter]) -> Result<Rows, DactylError>
pub fn read(&self, sql: &str, params: &[Parameter]) -> Result<Rows, DactylError>
Read application rows from the selected backend.
Sourcepub fn write_result(
&self,
sql: &str,
params: &[Parameter],
) -> Result<WriteResult, DactylError>
pub fn write_result( &self, sql: &str, params: &[Parameter], ) -> Result<WriteResult, DactylError>
Write application data and return the explicit physical result.
Sourcepub fn write(&self, sql: &str, params: &[Parameter]) -> Result<u64, DactylError>
pub fn write(&self, sql: &str, params: &[Parameter]) -> Result<u64, DactylError>
Write application data and return the affected count for compatibility.
pub fn atomic( &self, operations: &[Operation], ) -> Result<AtomicResult, DactylError>
pub fn access_mode(&self) -> AccessMode
Sourcepub fn inspect_schema(&self) -> Result<StoreSchema, DactylError>
pub fn inspect_schema(&self) -> Result<StoreSchema, DactylError>
Inspect the local SQLite catalog through the backend-neutral schema type.
Auto Trait Implementations§
impl !RefUnwindSafe for Connection
impl !Send for Connection
impl !Sync for Connection
impl !UnwindSafe for Connection
impl Freeze 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