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(&'static str)
Static strings are included in the query "as is".
Plain(String)
Plain strings are included in the query "as is".
Literal(String)
Literals are escaped with PQescapeLiteral
(which also places them into the single quotes).
Bytea(Vec<u8>)
Binary data, escaped with PQescapeByteaConn
. Single quotes aren't added by the escape.