Skip to main content

DbContextOptionsBuilderExt

Trait DbContextOptionsBuilderExt 

Source
pub trait DbContextOptionsBuilderExt {
    // Required methods
    fn use_postgres(&mut self, connection_string: &str) -> &mut Self;
    fn use_postgres_with_pool(
        &mut self,
        connection_string: &str,
        pool_size: usize,
    ) -> &mut Self;
    fn use_postgres_with_tls(
        &mut self,
        connection_string: &str,
        pool_size: usize,
        tls: PgTlsMode,
    ) -> &mut Self;
}

Required Methods§

Source

fn use_postgres(&mut self, connection_string: &str) -> &mut Self

Registers a PostgreSQL provider with a default pool size of 5.

Source

fn use_postgres_with_pool( &mut self, connection_string: &str, pool_size: usize, ) -> &mut Self

Registers a PostgreSQL provider with a configurable pool size. pool_size = 0 uses the deadpool default (CPU count).

Source

fn use_postgres_with_tls( &mut self, connection_string: &str, pool_size: usize, tls: PgTlsMode, ) -> &mut Self

Registers a PostgreSQL provider with configurable TLS.

PgTlsMode::Disable is equivalent to DbContextOptionsBuilderExt::use_postgres_with_pool. PgTlsMode::Require(connector) enforces TLS for all pooled connections using the platform’s native TLS implementation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl DbContextOptionsBuilderExt for DbContextOptionsBuilder

Source§

fn use_postgres(&mut self, connection_string: &str) -> &mut Self

Source§

fn use_postgres_with_pool( &mut self, connection_string: &str, pool_size: usize, ) -> &mut Self

Source§

fn use_postgres_with_tls( &mut self, connection_string: &str, pool_size: usize, tls: PgTlsMode, ) -> &mut Self

Implementors§