Struct tiberius::SqlConnection
[−]
[src]
pub struct SqlConnection<I: BoxableIo>(_);
A connection to a SQL server with an underlying IO (e.g. socket)
Methods
impl<I: BoxableIo + Sized + 'static> SqlConnection<I>
[src]
fn connect<E, T: ToIo<I>>(
handle: Handle,
endpoint: E
) -> SqlConnectionNew<I, T::Result> where
E: ToConnectEndpoint<I, T>,
[src]
handle: Handle,
endpoint: E
) -> SqlConnectionNew<I, T::Result> where
E: ToConnectEndpoint<I, T>,
Naive connection function for the SQL client
fn simple_query<'a, Q>(self, query: Q) -> ResultSetStream<I, QueryStream<I>> where
Q: Into<Cow<'a, str>>,
[src]
Q: Into<Cow<'a, str>>,
Execute a simple query and return multiple resultsets which consist of multiple rows.
Usually only one resultset will be interesting for which you can use
for_each_row
Warning
Do not use this with any user specified input. Please resort to prepared statements in order to prevent SQL-Injections.
fn simple_exec<'a, Q>(self, query: Q) -> ResultSetStream<I, ExecFuture<I>> where
Q: Into<Cow<'a, str>>,
[src]
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.
You can access each resultset (in most cases only one) using for_each
fn query<S: Into<Statement>>(
self,
stmt: S,
params: &[&ToSql]
) -> StmtStream<I, QueryStream<I>>
[src]
self,
stmt: S,
params: &[&ToSql]
) -> StmtStream<I, QueryStream<I>>
Execute a prepared statement and return each resultset and their associated rows
Usually only one resultset will be interesting for which you can use
for_each_row
fn exec<S: Into<Statement>>(
self,
stmt: S,
params: &[&ToSql]
) -> StmtStream<I, ExecFuture<I>>
[src]
self,
stmt: S,
params: &[&ToSql]
) -> StmtStream<I, ExecFuture<I>>
Execute a prepared statement and return the affected rows for each resultset
You can access each resultset (in most cases only one) using for_each
fn transaction(self) -> Box<Future<Item = Transaction<I>, Error = TdsError>>
[src]
Start a transaction
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.