z_db_worker behaviour (zotonic_core v1.0.0-rc.11)

Database pool worker behaviour definition

Link to this section Summary

Link to this section Callbacks

-callback equery(Worker, Sql, Parameters, Timeout) -> epgsql:reply(epgsql:equery_row())
          when
              Worker :: pid(),
              Sql :: string(),
              Parameters :: [epgsql:bind_param()],
              Timeout :: non_neg_integer().
-callback squery(Worker, Sql, Timeout) -> epgsql:reply(epgsql:squery_row())
          when Worker :: pid(), Sql :: string(), Timeout :: non_neg_integer().
Link to this callback

test_connection/1

-callback test_connection(WorkerArgs) -> ok | {error, Reason}
                   when WorkerArgs :: proplists:proplist(), Reason :: term().