[−][src]Struct hdbconnect::Connection
Connection object.
The connection to the database.
Example
use hdbconnect::{Connection, IntoConnectParams}; let params = "hdbsql://my_user:my_passwd@the_host:2222" .into_connect_params() .unwrap(); let mut connection = Connection::new(params).unwrap();
Methods
impl Connection
[src]
impl Connection
pub fn new(params: ConnectParams) -> HdbResult<Connection>
[src]
pub fn new(params: ConnectParams) -> HdbResult<Connection>
Factory method for authenticated connections.
pub fn set_auto_commit(&mut self, ac: bool) -> HdbResult<()>
[src]
pub fn set_auto_commit(&mut self, ac: bool) -> HdbResult<()>
Sets the connection's auto-commit behavior for future calls.
pub fn is_auto_commit(&self) -> HdbResult<bool>
[src]
pub fn is_auto_commit(&self) -> HdbResult<bool>
Returns the connection's auto-commit behavior.
pub fn set_fetch_size(&mut self, fetch_size: u32) -> HdbResult<()>
[src]
pub fn set_fetch_size(&mut self, fetch_size: u32) -> HdbResult<()>
Configures the connection's fetch size for future calls.
pub fn get_lob_read_length(&self) -> HdbResult<i32>
[src]
pub fn get_lob_read_length(&self) -> HdbResult<i32>
Configures the connection's lob read length for future calls.
pub fn set_lob_read_length(&mut self, l: i32) -> HdbResult<()>
[src]
pub fn set_lob_read_length(&mut self, l: i32) -> HdbResult<()>
Configures the connection's lob read length for future calls.
pub fn get_server_resource_consumption_info(
&self
) -> HdbResult<ServerResourceConsumptionInfo>
[src]
pub fn get_server_resource_consumption_info(
&self
) -> HdbResult<ServerResourceConsumptionInfo>
pub fn get_call_count(&self) -> HdbResult<i32>
[src]
pub fn get_call_count(&self) -> HdbResult<i32>
Returns the number of roundtrips to the database that have been done through this connection.
pub fn set_application_user(&self, appl_user: &str) -> HdbResult<()>
[src]
pub fn set_application_user(&self, appl_user: &str) -> HdbResult<()>
Sets client information into a session variable on the server.
Example:
connection.set_application_user("K2209657")?;
pub fn set_application_version(&mut self, version: &str) -> HdbResult<()>
[src]
pub fn set_application_version(&mut self, version: &str) -> HdbResult<()>
Sets client information into a session variable on the server.
Example:
connection.set_application_version("5.3.23")?;
pub fn set_application_source(&mut self, source: &str) -> HdbResult<()>
[src]
pub fn set_application_source(&mut self, source: &str) -> HdbResult<()>
Sets client information into a session variable on the server.
Example:
connection.set_application_source("5.3.23","update_customer.rs")?;
pub fn statement(&mut self, stmt: &str) -> HdbResult<HdbResponse>
[src]
pub fn statement(&mut self, stmt: &str) -> HdbResult<HdbResponse>
Executes a statement on the database.
This generic method can handle all kinds of calls, and thus has the most complex return type. In many cases it will be more appropriate to use one of the methods query(), dml(), exec(), which have the adequate simple result type you usually want.
pub fn query(&mut self, stmt: &str) -> HdbResult<ResultSet>
[src]
pub fn query(&mut self, stmt: &str) -> HdbResult<ResultSet>
Executes a statement and expects a single ResultSet.
pub fn dml(&mut self, stmt: &str) -> HdbResult<usize>
[src]
pub fn dml(&mut self, stmt: &str) -> HdbResult<usize>
Executes a statement and expects a single number of affected rows.
pub fn exec(&mut self, stmt: &str) -> HdbResult<()>
[src]
pub fn exec(&mut self, stmt: &str) -> HdbResult<()>
Executes a statement and expects a plain success.
pub fn prepare(&self, stmt: &str) -> HdbResult<PreparedStatement>
[src]
pub fn prepare(&self, stmt: &str) -> HdbResult<PreparedStatement>
Prepares a statement and returns a handle to it.
Note that the handle keeps using the same connection.
pub fn commit(&mut self) -> HdbResult<()>
[src]
pub fn commit(&mut self) -> HdbResult<()>
Commits the current transaction.
pub fn rollback(&mut self) -> HdbResult<()>
[src]
pub fn rollback(&mut self) -> HdbResult<()>
Rolls back the current transaction.
pub fn spawn(&self) -> HdbResult<Connection>
[src]
pub fn spawn(&self) -> HdbResult<Connection>
Creates a new connection object with the same settings and authentication.
pub fn multiple_statements_ignore_err<S: AsRef<str>>(&mut self, stmts: Vec<S>)
[src]
pub fn multiple_statements_ignore_err<S: AsRef<str>>(&mut self, stmts: Vec<S>)
Utility method to fire a couple of statements, ignoring errors and return values
pub fn multiple_statements<S: AsRef<str>>(
&mut self,
stmts: Vec<S>
) -> HdbResult<()>
[src]
pub fn multiple_statements<S: AsRef<str>>(
&mut self,
stmts: Vec<S>
) -> HdbResult<()>
Utility method to fire a couple of statements, ignoring their return values; the method returns with the first error, or with ()
pub fn pop_warnings(&self) -> HdbResult<Option<Vec<ServerError>>>
[src]
pub fn pop_warnings(&self) -> HdbResult<Option<Vec<ServerError>>>
Returns warnings that were returned from the server since the last call to this method.
pub fn get_resource_manager(&self) -> Box<dyn ResourceManager>
[src]
pub fn get_resource_manager(&self) -> Box<dyn ResourceManager>
Returns an implementation of dist_tx::rm::ResourceManager
that is
based on this connection.
pub fn execute_with_debuginfo(
&mut self,
stmt: &str,
module: &str,
line: i32
) -> HdbResult<HdbResponse>
[src]
pub fn execute_with_debuginfo(
&mut self,
stmt: &str,
module: &str,
line: i32
) -> HdbResult<HdbResponse>
Tools like debuggers can provide additional information while stepping through a source
Trait Implementations
Auto Trait Implementations
impl Send for Connection
impl Send for Connection
impl Sync for Connection
impl Sync for Connection
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T> Same for T
impl<T> Same for T
type Output = T
Should always be Self