connection_pools
Overview
Name | connection_pools |
Type | Resource |
Id | digitalocean.databases.connection_pools |
Fields
Name | Datatype | Description |
---|---|---|
name | string | A unique name for the connection pool. Must be between 3 and 60 characters. |
connection | object | |
db | string | The database for use with the connection pool. |
mode | string | The PGBouncer transaction mode for the connection pool. The allowed values are session, transaction, and statement. |
private_connection | object | |
size | integer | The desired size of the PGBouncer connection pool. The maximum allowed size is determined by the size of the cluster's primary node. 25 backend server connections are allowed for every 1GB of RAM. Three are reserved for maintenance. For example, a primary node with 1 GB of RAM allows for a maximum of 22 backend server connections while one with 4 GB would allow for 97. Note that these are shared across all connection pools in a cluster. |
user | string | The name of the user for use with the connection pool. When excluded, all sessions connect to the database as the inbound user. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get_connectionPool | SELECT | database_cluster_uuid, pool_name | To show information about an existing connection pool for a PostgreSQL database cluster, send a GET request to /v2/databases/$DATABASE_ID/pools/$POOL_NAME .The response will be a JSON object with a pool key. |
list_connectionPools | SELECT | database_cluster_uuid | To list all of the connection pools available to a PostgreSQL database cluster, send a GET request to /v2/databases/$DATABASE_ID/pools .The result will be a JSON object with a pools key. This will be set to an array of connection pool objects. |
add_connectionPool | INSERT | database_cluster_uuid, data__db, data__mode, data__name, data__size | For PostgreSQL database clusters, connection pools can be used to allow a database to share its idle connections. The popular PostgreSQL connection pooling utility PgBouncer is used to provide this service. See here for more information about how and why to use PgBouncer connection pooling including details about the available transaction modes. To add a new connection pool to a PostgreSQL database cluster, send a POST request to /v2/databases/$DATABASE_ID/pools specifying a name for the pool,the user to connect with, the database to connect to, as well as its desired size and transaction mode. |
delete_connectionPool | DELETE | database_cluster_uuid, pool_name | To delete a specific connection pool for a PostgreSQL database cluster, send a DELETE request to /v2/databases/$DATABASE_ID/pools/$POOL_NAME .A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. |
_get_connectionPool | EXEC | database_cluster_uuid, pool_name | To show information about an existing connection pool for a PostgreSQL database cluster, send a GET request to /v2/databases/$DATABASE_ID/pools/$POOL_NAME .The response will be a JSON object with a pool key. |
_list_connectionPools | EXEC | database_cluster_uuid | To list all of the connection pools available to a PostgreSQL database cluster, send a GET request to /v2/databases/$DATABASE_ID/pools .The result will be a JSON object with a pools key. This will be set to an array of connection pool objects. |
update_connectionPool | EXEC | database_cluster_uuid, pool_name, data__db, data__mode, data__size | To update a connection pool for a PostgreSQL database cluster, send a PUT request to /v2/databases/$DATABASE_ID/pools/$POOL_NAME . |