Skip to main content
pub struct KineticaPoolOptions  /* private fields */ 

Builder for creating Kinetica connection pools with sensible defaults.

Example

Implementations

Source

pub fn new() -> Self

Create a new KineticaPoolOptions with default settings.

Source

pub fn host(self, host: &str) -> Self

Set the host address.

Source

pub fn port(self, port: u16) -> Self

Set the port (default: 5432).

Source

pub fn username(self, username: &str) -> Self

Set the username for authentication.

Source

pub fn password(self, password: &str) -> Self

Set the password for authentication.

Source

pub fn database(self, database: &str) -> Self

Set the database name (default: “postgres”).

Source

pub fn max_connections(self, max: u32) -> Self

Set the maximum number of connections in the pool (default: 10).

Source

pub fn min_connections(self, min: u32) -> Self

Set the minimum number of connections to maintain (default: 0).

Source

pub fn acquire_timeout(self, timeout: Duration) -> Self

Set the timeout for acquiring a connection from the pool (default: 30s).

Source

pub fn idle_timeout(self, timeout: Option<Duration>) -> Self

Set the idle timeout for connections (default: 600s). Set to None to disable idle timeout.

Source

pub fn max_lifetime(self, lifetime: Option<Duration>) -> Self

Set the maximum lifetime of connections (default: 1800s). Set to None to disable max lifetime.

Source

pub fn ssl_mode(self, mode: SslMode) -> Self

Set the SSL mode for connections.

Build the connection URL string.

Source

pub fn connect_options(&self) -> Result<PgConnectOptions, SqlxError>

Build PgConnectOptions from the current settings.

Source

pub async fn connect(&self) -> Result<KineticaPool, SqlxError>

Connect and create a connection pool.

Trait Implementations

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source

fn fmt(&self, f: &mut Formatter<’_>) -> Result

Formats the value using the given formatter. Read more
Source

fn default() -> Self

Returns the “default value” for a type. Read more