Ecto.Adapters.Postgres

Adapter module for PostgreSQL.

It handles and pools the connections to the postgres database with poolboy.

Options

Postgrex options split in different categories described below. All options should be given via the repository configuration.

Connection options

Pool options

Storage options

Source

Summary

query(repo, sql, params, opts \\ [])

Run custom SQL query on given repo

Functions

query(repo, sql, params, opts \\ [])

Run custom SQL query on given repo.

Options

:timeout - The time in milliseconds to wait for the call to finish, :infinity will wait indefinitely (default: 5000);

Examples

iex> Postgres.query(MyRepo, "SELECT $1 + $2", [40, 2])
%Postgrex.Result{command: :select, columns: ["?column?"], rows: [{42}], num_rows: 1}
Source