Connection.execParams

Executes the given string with given params

Params should be given as $1, $2, ... $n in the actual command. All params are sent in a binary format and should not be escaped. If a param's type cannot be inferred, this method will throw an exception, in this case, either specify the type using the :: (cast) notation or make sure the type can be inferred by PostgreSQL in your query.

  1. Result execParams(string command, T params)
    struct Connection
    execParams
    (
    T...
    )
    (
    string command
    ,)
  2. Result execParams(string command, Value[] params, bool async)

Examples

Connection conn; // An established connection

conn.execParams("SELECT $1::string, $2::int, $3::double");

See also: http://www.postgresql.org/docs/9.3/static/libpq-exec.html

Meta