pub struct Connection<'a> { /* private fields */ }Implementations§
Source§impl<'a> Connection<'a>
impl<'a> Connection<'a>
pub fn open(db: &'a Database) -> Result<Self>
Sourcepub fn txn_start_ts(&self) -> Option<i64>
pub fn txn_start_ts(&self) -> Option<i64>
Txn-start UTC µs inside BEGIN/COMMIT, else None.
Sourcepub fn session_timezone(&self) -> String
pub fn session_timezone(&self) -> String
Returns the session time-zone (IANA name or fixed offset). Default "UTC".
Sourcepub fn set_session_timezone(&self, tz: &str) -> Result<()>
pub fn set_session_timezone(&self, tz: &str) -> Result<()>
Set the session time-zone. Accepts IANA names, ISO-8601 offsets, "UTC", "Z".
pub fn execute(&self, sql: &str) -> Result<ExecutionResult>
pub fn execute_params( &self, sql: &str, params: &[Value], ) -> Result<ExecutionResult>
Sourcepub fn execute_script(&self, sql: &str) -> ScriptExecution
pub fn execute_script(&self, sql: &str) -> ScriptExecution
Execute ;-separated SQL statements. Stops at the first failure.
pub fn query(&self, sql: &str) -> Result<QueryResult>
pub fn query_params(&self, sql: &str, params: &[Value]) -> Result<QueryResult>
pub fn prepare(&self, sql: &str) -> Result<PreparedStatement<'_, 'a>>
pub fn tables(&self) -> Vec<String>
Sourcepub fn in_transaction(&self) -> bool
pub fn in_transaction(&self) -> bool
Returns true if an explicit transaction is active (BEGIN was issued).
pub fn table_schema(&self, name: &str) -> Option<TableSchema>
pub fn refresh_schema(&self) -> Result<()>
Trait Implementations§
Source§impl<'a> Drop for Connection<'a>
impl<'a> Drop for Connection<'a>
Auto Trait Implementations§
impl<'a> !Freeze for Connection<'a>
impl<'a> !RefUnwindSafe for Connection<'a>
impl<'a> Send for Connection<'a>
impl<'a> !Sync for Connection<'a>
impl<'a> Unpin for Connection<'a>
impl<'a> UnsafeUnpin for Connection<'a>
impl<'a> !UnwindSafe for Connection<'a>
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