tembo_api_client/models/connection_pooler.rs
1/*
2 * Tembo Cloud
3 *
4 * Platform API for Tembo Cloud </br> </br> To find a Tembo Data API, please find it here: </br> </br> [AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/)
5 *
6 * The version of the OpenAPI document: v1.0.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ConnectionPooler : A connection pooler is a tool used to manage database connections, sitting between your application and Postgres instance. Because of the way Postgres handles connections, the server may encounter resource constraint issues when managing a few thousand connections. Using a pooler can alleviate these issues by using actual Postgres connections only when necessary **Example**: A typical connection pooler configuration ```yaml apiVersion: coredb.io/v1alpha1 kind: CoreDB metadata: name: test-db spec: connectionPooler: enabled: true pooler: poolMode: transaction # Valid parameter values can be found at https://www.pgbouncer.org/config.html parameters: default_pool_size: \"50\" max_client_conn: \"5000\" resources: limits: cpu: 200m memory: 256Mi requests: cpu: 100m memory: 128Mi ```
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ConnectionPooler {
17 /// Enable the connection pooler **Default**: false.
18 #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
19 pub enabled: Option<bool>,
20 #[serde(rename = "pooler", skip_serializing_if = "Option::is_none")]
21 pub pooler: Option<Box<models::PgBouncer>>,
22}
23
24impl ConnectionPooler {
25 /// A connection pooler is a tool used to manage database connections, sitting between your application and Postgres instance. Because of the way Postgres handles connections, the server may encounter resource constraint issues when managing a few thousand connections. Using a pooler can alleviate these issues by using actual Postgres connections only when necessary **Example**: A typical connection pooler configuration ```yaml apiVersion: coredb.io/v1alpha1 kind: CoreDB metadata: name: test-db spec: connectionPooler: enabled: true pooler: poolMode: transaction # Valid parameter values can be found at https://www.pgbouncer.org/config.html parameters: default_pool_size: \"50\" max_client_conn: \"5000\" resources: limits: cpu: 200m memory: 256Mi requests: cpu: 100m memory: 128Mi ```
26 pub fn new() -> ConnectionPooler {
27 ConnectionPooler {
28 enabled: None,
29 pooler: None,
30 }
31 }
32}