pub struct PostgresBootstrapProviderBuilder { /* private fields */ }Expand description
Builder for PostgresBootstrapProvider
§Example
use drasi_bootstrap_postgres::PostgresBootstrapProvider;
let provider = PostgresBootstrapProvider::builder()
.with_host("localhost")
.with_port(5432)
.with_database("mydb")
.with_user("postgres")
.with_password("secret")
.with_tables(vec!["users".to_string()])
.build();Implementations§
Source§impl PostgresBootstrapProviderBuilder
impl PostgresBootstrapProviderBuilder
Sourcepub fn with_database(self, database: impl Into<String>) -> Self
pub fn with_database(self, database: impl Into<String>) -> Self
Set the database name
Sourcepub fn with_password(self, password: impl Into<String>) -> Self
pub fn with_password(self, password: impl Into<String>) -> Self
Set the password
Sourcepub fn with_tables(self, tables: Vec<String>) -> Self
pub fn with_tables(self, tables: Vec<String>) -> Self
Set the tables to bootstrap
Sourcepub fn with_table(self, table: impl Into<String>) -> Self
pub fn with_table(self, table: impl Into<String>) -> Self
Add a table to bootstrap
Sourcepub fn with_slot_name(self, slot_name: impl Into<String>) -> Self
pub fn with_slot_name(self, slot_name: impl Into<String>) -> Self
Set the replication slot name
Sourcepub fn with_publication_name(self, publication_name: impl Into<String>) -> Self
pub fn with_publication_name(self, publication_name: impl Into<String>) -> Self
Set the publication name
Sourcepub fn with_ssl_mode(self, ssl_mode: SslMode) -> Self
pub fn with_ssl_mode(self, ssl_mode: SslMode) -> Self
Set the SSL mode
Sourcepub fn with_table_keys(self, table_keys: Vec<TableKeyConfig>) -> Self
pub fn with_table_keys(self, table_keys: Vec<TableKeyConfig>) -> Self
Set the table key configurations
Sourcepub fn with_table_key(
self,
table: impl Into<String>,
key_columns: Vec<String>,
) -> Self
pub fn with_table_key( self, table: impl Into<String>, key_columns: Vec<String>, ) -> Self
Add a table key configuration
Sourcepub fn build(self) -> PostgresBootstrapProvider
pub fn build(self) -> PostgresBootstrapProvider
Build the PostgresBootstrapProvider
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PostgresBootstrapProviderBuilder
impl RefUnwindSafe for PostgresBootstrapProviderBuilder
impl Send for PostgresBootstrapProviderBuilder
impl Sync for PostgresBootstrapProviderBuilder
impl Unpin for PostgresBootstrapProviderBuilder
impl UnwindSafe for PostgresBootstrapProviderBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more