prepare abstract method

Future<PgStatement> prepare(
  1. Object query
)

Prepares a reusable statement from a query.

Query can either be a string or a PgSql instance. The query value used alters the behavior of PgStatement.bind: When a string is used, the query is sent to Postgres without modification and you may only used indexed parameters (e.g. SELECT * FROM users WHERE id = $1). When using PgSql.map, you can use named parameters as well (e.g. WHERE id = @id).

When the returned future completes, the statement must eventually be freed using PgStatement.close to avoid resource leaks.

Implementation

Future<PgStatement> prepare(Object /* String | PgSql */ query);