Constructor

PgsqlConnectionPoolnew

Declaration

DexFuture*
pgsql_connection_pool_new (
  const char* const* keywords,
  const char* const* values,
  int expand_dbname,
  guint min_size,
  guint max_size
)

Description

Creates a new PgsqlConnectionPool asynchronously and attempts to warm up the pool by establishing min_size connections.

The keywords and values arrays must be parallel arrays containing connection parameters such as “host”, “port”, “dbname”, “user”, “password”, etc.

The pool will maintain at least min_size connections and can grow up to max_size connections as needed. max_size must be greater than or equal to min_size.

Parameters

keywords

Type: An array of char*

Array of connection parameter keywords.

The array must be NULL-terminated.
The data is owned by the caller of the function.
Each element is a NUL terminated UTF-8 string.
values

Type: An array of char*

Array of connection parameter values.

The array must be NULL-terminated.
The data is owned by the caller of the function.
Each element is a NUL terminated UTF-8 string.
expand_dbname

Type: int

Whether to expand the database name.

min_size

Type: guint

Minimum size of the connection pool.

max_size

Type: guint

Maximum size of the connection pool.

Return value

Type: DexFuture

A DexFuture that resolves to a PgsqlConnectionPool or rejects with error.

The caller of the function takes ownership of the data, and is responsible for freeing it.