[][src]Struct tiberius::SqlConnection

pub struct SqlConnection<I: BoxableIo>(_);

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]

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]

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]

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]

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]

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]

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]

Start a transaction

pub fn prepare<S>(&self, stmt: S) -> Statement where
    S: Into<Cow<'static, str>>, 
[src]

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

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Erased for T