epgsql_pool.hrl 938 B

123456789101112131415161718192021222324252627
  1. -define(DB_QUERY_TIMEOUT, 10000).
  2. -define(DB_POOLER_GET_WORKER_TIMEOUT, 1000).
  3. -define(DB_MAX_RECONNECT_TIMEOUT, 3000).
  4. -define(DB_MIN_RECONNECT_TIMEOUT, 100).
  5. -type(pool_name() :: binary() | string() | atom()).
  6. -type(db_query() :: binary() | string()). % TODO: did driver accepts string?
  7. -type(db_reply() :: term()). % TODO: narrow type
  8. -record(epgsql_connection_params, {
  9. host :: string() | binary(),
  10. port :: non_neg_integer(),
  11. username :: string() | binary(),
  12. password :: string() | binary(),
  13. database :: string() | binary()
  14. }).
  15. -record(epgsql_connection, {
  16. connection :: pid(),
  17. params :: #epgsql_connection_params{},
  18. connection_timeout :: non_neg_integer(),
  19. query_timeout :: non_neg_integer(),
  20. reconnect_attempt = 0 :: non_neg_integer(),
  21. reconnect_timeout = 0 :: non_neg_integer()
  22. }).