pydo.databases.add_connection_pool()
Generated on 3 Aug 2026
from pydo version
v0.40.0
Usage
client.databases.add_connection_pool(
database_cluster_uuid="9cc10173-e9ea-4176-9dbc-a4cee4c4ff30",
body={
"name": "backend-pool",
"mode": "transaction",
"size": 10,
...,
},
)Description
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_cluster_uuid}/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.
Parameters
database_cluster_uuidstring requiredA unique identifier for a database cluster.
namestring requiredExample:
backend-poolA unique name for the connection pool. Must be between 3 and 60 characters.
modestring requiredExample:
transactionThe PGBouncer transaction mode for the connection pool. The allowed values are session, transaction, and statement.
sizeinteger requiredExample:
10The 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.
dbstring requiredExample:
defaultdbThe database for use with the connection pool.
userstring optionalExample:
doadminThe name of the user for use with the connection pool. When excluded, all sessions connect to the database as the inbound user.
connectionobject optionalShow child properties
uristring optional read-onlyExample:
postgres://doadmin:wv78n3zpz42xezdk@backend-do-user-19081923-0.db.ondigitalocean.com:25060/defaultdb?sslmode=requireA connection string in the format accepted by the
psqlcommand. This is provided as a convenience and should be able to be constructed by the other attributes.databasestring optional read-onlyExample:
defaultdbThe name of the default database.
hoststring optional read-onlyExample:
backend-do-user-19081923-0.db.ondigitalocean.comThe FQDN pointing to the database cluster's current primary node.
portinteger optional read-onlyExample:
25060The port on which the database cluster is listening.
userstring optional read-onlyExample:
doadminThe default user for the database.
Requiresdatabase:view_credentialsscope.passwordstring optional read-onlyExample:
wv78n3zpz42xezdkThe randomly generated password for the default user.
Requiresdatabase:view_credentialsscope.sslboolean optional read-onlyExample:
TrueA boolean value indicating if the connection should be made over SSL.
private_connectionobject optionalShow child properties
uristring optional read-onlyExample:
postgres://doadmin:wv78n3zpz42xezdk@backend-do-user-19081923-0.db.ondigitalocean.com:25060/defaultdb?sslmode=requireA connection string in the format accepted by the
psqlcommand. This is provided as a convenience and should be able to be constructed by the other attributes.databasestring optional read-onlyExample:
defaultdbThe name of the default database.
hoststring optional read-onlyExample:
backend-do-user-19081923-0.db.ondigitalocean.comThe FQDN pointing to the database cluster's current primary node.
portinteger optional read-onlyExample:
25060The port on which the database cluster is listening.
userstring optional read-onlyExample:
doadminThe default user for the database.
Requiresdatabase:view_credentialsscope.passwordstring optional read-onlyExample:
wv78n3zpz42xezdkThe randomly generated password for the default user.
Requiresdatabase:view_credentialsscope.sslboolean optional read-onlyExample:
TrueA boolean value indicating if the connection should be made over SSL.
standby_connectionobject optionalShow child properties
uristring optional read-onlyExample:
postgres://doadmin:wv78n3zpz42xezdk@backend-do-user-19081923-0.db.ondigitalocean.com:25060/defaultdb?sslmode=requireA connection string in the format accepted by the
psqlcommand. This is provided as a convenience and should be able to be constructed by the other attributes.databasestring optional read-onlyExample:
defaultdbThe name of the default database.
hoststring optional read-onlyExample:
backend-do-user-19081923-0.db.ondigitalocean.comThe FQDN pointing to the database cluster's current primary node.
portinteger optional read-onlyExample:
25060The port on which the database cluster is listening.
userstring optional read-onlyExample:
doadminThe default user for the database.
Requiresdatabase:view_credentialsscope.passwordstring optional read-onlyExample:
wv78n3zpz42xezdkThe randomly generated password for the default user.
Requiresdatabase:view_credentialsscope.sslboolean optional read-onlyExample:
TrueA boolean value indicating if the connection should be made over SSL.
standby_private_connectionobject optionalShow child properties
uristring optional read-onlyExample:
postgres://doadmin:wv78n3zpz42xezdk@backend-do-user-19081923-0.db.ondigitalocean.com:25060/defaultdb?sslmode=requireA connection string in the format accepted by the
psqlcommand. This is provided as a convenience and should be able to be constructed by the other attributes.databasestring optional read-onlyExample:
defaultdbThe name of the default database.
hoststring optional read-onlyExample:
backend-do-user-19081923-0.db.ondigitalocean.comThe FQDN pointing to the database cluster's current primary node.
portinteger optional read-onlyExample:
25060The port on which the database cluster is listening.
userstring optional read-onlyExample:
doadminThe default user for the database.
Requiresdatabase:view_credentialsscope.passwordstring optional read-onlyExample:
wv78n3zpz42xezdkThe randomly generated password for the default user.
Requiresdatabase:view_credentialsscope.sslboolean optional read-onlyExample:
TrueA boolean value indicating if the connection should be made over SSL.
Request Sample
Response Example
More Information
See /v2/databases/{database_cluster_uuid}/pools in the API reference for additional detail on responses, headers, parameters, and more.