Skip to main content

Crate drasi_bootstrap_postgres

Crate drasi_bootstrap_postgres 

Source
Expand description

PostgreSQL bootstrap plugin for Drasi

This plugin provides the PostgreSQL bootstrap provider implementation following the instance-based plugin architecture.

§Example

use drasi_bootstrap_postgres::PostgresBootstrapProvider;

// Using the builder
let provider = PostgresBootstrapProvider::builder()
    .with_host("localhost")
    .with_port(5432)
    .with_database("mydb")
    .with_user("user")
    .with_password("password")
    .with_tables(vec!["users".to_string()])
    .build();

// Or using configuration
use drasi_bootstrap_postgres::{PostgresBootstrapConfig, SslMode};

let config = PostgresBootstrapConfig {
    host: "localhost".to_string(),
    port: 5432,
    database: "mydb".to_string(),
    user: "user".to_string(),
    password: "password".to_string(),
    tables: vec!["users".to_string()],
    slot_name: "drasi_slot".to_string(),
    publication_name: "drasi_pub".to_string(),
    ssl_mode: SslMode::Disable,
    table_keys: vec![],
};
let provider = PostgresBootstrapProvider::new(config);

Re-exports§

pub use config::PostgresBootstrapConfig;
pub use config::SslMode;
pub use config::TableKeyConfig;
pub use postgres::PostgresBootstrapProvider;
pub use postgres::PostgresBootstrapProviderBuilder;

Modules§

config
Configuration types for the PostgreSQL bootstrap provider.
postgres
PostgreSQL bootstrap provider for reading initial data from PostgreSQL databases