pub struct Statement<'l> { /* private fields */ }
Expand description

A prepared statement.

Implementations

Bind a value to a parameter by index.

The first parameter has index 1.

Bind a value to a parameter by name.

Examples
let mut statement = connection.prepare("SELECT * FROM users WHERE name = :name")?;
statement.bind_by_name(":name", "Bob")?;

Return the number of columns.

Return the name of a column.

The first column has index 0.

Return column names.

Return the type of a column.

The first column has index 0. The type becomes available after taking a step.

Advance to the next state.

The function should be called multiple times until State::Done is reached in order to evaluate the statement entirely.

Return the index for a named parameter if exists.

Examples
let statement = connection.prepare("SELECT * FROM users WHERE name = :name")?;
assert_eq!(statement.parameter_index(":name")?.unwrap(), 1);
assert_eq!(statement.parameter_index(":asdf")?, None);

Read a value from a column.

The first column has index 0.

Reset the statement.

Upgrade to a cursor.

Return the raw pointer.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.