Struct af_postgres::StatementBuilder [−][src]
A helper struct for building a complex one-off statement its parameter values.
Implementations
impl<'a> StatementBuilder<'a>
[src]
pub fn new() -> Self
[src]
Creates a new, empty statement builder.
pub fn append(&mut self, text: impl Display)
[src]
Appends text to the query.
pub fn add_param(&mut self, param: &'a (dyn ToSql + Sync)) -> usize
[src]
Adds a parameter to the statement and returns its index.
The index is the number to use as a placeholder in statement text. This is intended for adding parameters when the number of parameters is not known at compile time. For example:
ⓘ
write!(builder, "WHERE id = ${}", builder.add_param(id))?;
pub fn params(&self) -> &[&'a (dyn ToSql + Sync)]ⓘ
[src]
Returns a reference to the statement params.
pub fn text(&self) -> &str
[src]
Returns a reference to the statement text.
Trait Implementations
impl<'a> Debug for StatementBuilder<'a>
[src]
impl Default for StatementBuilder<'_>
[src]
impl<'a> Write for StatementBuilder<'a>
[src]
Auto Trait Implementations
impl<'a> !RefUnwindSafe for StatementBuilder<'a>
impl<'a> Send for StatementBuilder<'a>
impl<'a> Sync for StatementBuilder<'a>
impl<'a> Unpin for StatementBuilder<'a>
impl<'a> !UnwindSafe for StatementBuilder<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,