Enum pg_async::PgQueryPiece [] [src]

pub enum PgQueryPiece {
    Static(&'static str),
    Plain(String),
    Literal(String),
    Bytea(Vec<u8>),
}

A part of an SQL query text. The query is constructed by adding Plain pieces "as is" and escaping the Literal pieces.

For example, a properly escaped "SELECT 'foo'" might be generated with

    use pg_async::PgQueryPiece::{Static as S, Literal as L};
    vec![S("SELECT "), L("foo".into)]

Variants

Static strings are included in the query "as is".

Plain strings are included in the query "as is".

Literals are escaped with PQescapeLiteral (which also places them into the single quotes).

Binary data, escaped with PQescapeByteaConn. Single quotes aren't added by the escape.

Trait Implementations

impl Debug for PgQueryPiece
[src]

Formats the value using the given formatter.