pub struct SiodbConn { /* private fields */ }Expand description
A connection to Siodb.
For instance:
let uri = "siodbs://root@localhost:50000?identity_file=/home/siodb/.ssh/id_rsa";
let mut siodb_conn = SiodbConn::new(&uri).expect(&format!("Error connecting to URI '{}'", uri));Implementations§
Source§impl SiodbConn
impl SiodbConn
Sourcepub fn new(uri_str: &str) -> Result<SiodbConn, DriverError>
pub fn new(uri_str: &str) -> Result<SiodbConn, DriverError>
Create a new authenticated connection to Siodb from an URI.
Sourcepub fn execute(&mut self, sql: String) -> Result<(), DriverError>
pub fn execute(&mut self, sql: String) -> Result<(), DriverError>
Execute a statement in a connection.
Sourcepub fn query_row(&mut self, sql: String) -> Option<Vec<Option<Value>>>
pub fn query_row(&mut self, sql: String) -> Option<Vec<Option<Value>>>
Execute a query in a connection, return the first row and discard the others.
Sourcepub fn query(&mut self, sql: String) -> Result<(), DriverError>
pub fn query(&mut self, sql: String) -> Result<(), DriverError>
Execute a query in a connection.
Sourcepub fn get_row_count(&mut self) -> u64
pub fn get_row_count(&mut self) -> u64
Return the total number of rows read to far from next().
Sourcepub fn get_affected_row_count(&mut self) -> u64
pub fn get_affected_row_count(&mut self) -> u64
Return the number of affected rows from the previous statement.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SiodbConn
impl RefUnwindSafe for SiodbConn
impl Send for SiodbConn
impl Sync for SiodbConn
impl Unpin for SiodbConn
impl UnwindSafe for SiodbConn
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