[−][src]Struct tiberius::SqlConnection
A connection to a SQL server with an underlying IO (e.g. socket)
Methods
impl SqlConnection<Box<dyn BoxableIo>>
[src]
pub fn connect(
connection_str: &str
) -> Box<dyn Future<Item = SqlConnection<Box<dyn BoxableIo>>, Error = Error> + Send>
[src]
connection_str: &str
) -> Box<dyn Future<Item = SqlConnection<Box<dyn BoxableIo>>, Error = Error> + Send>
Naive connection function for the SQL client
impl<I: BoxableIo + Sized + 'static> SqlConnection<I>
[src]
pub fn connect_to<F>(
params: ConnectParams,
target: F
) -> impl Future<Item = SqlConnection<I>, Error = Error> where
F: Future<Item = I, Error = Error> + Sync + Send,
[src]
params: ConnectParams,
target: F
) -> impl Future<Item = SqlConnection<I>, Error = Error> where
F: Future<Item = I, Error = Error> + Sync + Send,
Connect to the SQL server using given params and chosen stream
pub fn simple_query<'a, Q>(
self,
query: Q
) -> QueryResult<ResultSetStream<I, QueryStream<I>>> where
Q: Into<Cow<'a, str>>,
[src]
self,
query: Q
) -> QueryResult<ResultSetStream<I, QueryStream<I>>> where
Q: Into<Cow<'a, str>>,
Execute a simple query and return multiple resultsets which consist of multiple rows.
Warning
Do not use this with any user specified input.
Please resort to prepared statements in order to prevent SQL-Injections.
You can access one resultset using for_each
If you want to access multiple resultsets, go through into_stream
pub fn simple_exec<'a, Q>(
self,
query: Q
) -> ExecResult<ResultSetStream<I, ExecFuture<I>>> where
Q: Into<Cow<'a, str>>,
[src]
self,
query: Q
) -> ExecResult<ResultSetStream<I, ExecFuture<I>>> where
Q: Into<Cow<'a, str>>,
Execute a simple SQL-statement and return the affected rows
Warning
Do not use this with any user specified input.
Please resort to prepared statements in order to prevent SQL-Injections.
If you want to access multiple resultsets, go through into_stream
pub fn query<S: Into<Statement>>(
self,
stmt: S,
params: &[&dyn ToSql]
) -> QueryResult<StmtStream<I, QueryStream<I>>>
[src]
self,
stmt: S,
params: &[&dyn ToSql]
) -> QueryResult<StmtStream<I, QueryStream<I>>>
Execute a prepared statement and return each resultset and their associated rows
You can access one resultset using for_each
If you want to access multiple resultsets, go through into_stream
pub fn exec<S: Into<Statement>>(
self,
stmt: S,
params: &[&dyn ToSql]
) -> ExecResult<StmtStream<I, ExecFuture<I>>>
[src]
self,
stmt: S,
params: &[&dyn ToSql]
) -> ExecResult<StmtStream<I, ExecFuture<I>>>
Execute a prepared statement and return the affected rows for each resultset
If you want to access multiple resultsets, go through into_stream
pub fn transaction(
self
) -> Box<dyn Future<Item = Transaction<I>, Error = Error>>
[src]
self
) -> Box<dyn Future<Item = Transaction<I>, Error = Error>>
Start a transaction
pub fn prepare<S>(&self, stmt: S) -> Statement where
S: Into<Cow<'static, str>>,
[src]
S: Into<Cow<'static, str>>,
Create a statement associated to a given SQL which can be executed later on
This is a lazy operation and will not do anything until the first call. The statement is prepared with the sql-types of the given parameters. It will only be reprepared if the given parameter's rust-types resolve to different sql-types as given for the first execution.
Auto Trait Implementations
impl<I> Send for SqlConnection<I>
impl<I> Sync for SqlConnection<I> where
I: Sync,
I: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.