drasi_bootstrap_postgres/lib.rs
1// Copyright 2025 The Drasi Authors.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! PostgreSQL bootstrap plugin for Drasi
16//!
17//! This plugin provides the PostgreSQL bootstrap provider implementation following
18//! the instance-based plugin architecture.
19//!
20//! # Example
21//!
22//! ```no_run
23//! use drasi_bootstrap_postgres::PostgresBootstrapProvider;
24//!
25//! // Using the builder
26//! let provider = PostgresBootstrapProvider::builder()
27//! .with_host("localhost")
28//! .with_port(5432)
29//! .with_database("mydb")
30//! .with_user("user")
31//! .with_password("password")
32//! .with_tables(vec!["users".to_string()])
33//! .build();
34//!
35//! // Or using configuration
36//! use drasi_bootstrap_postgres::{PostgresBootstrapConfig, SslMode};
37//!
38//! let config = PostgresBootstrapConfig {
39//! host: "localhost".to_string(),
40//! port: 5432,
41//! database: "mydb".to_string(),
42//! user: "user".to_string(),
43//! password: "password".to_string(),
44//! tables: vec!["users".to_string()],
45//! slot_name: "drasi_slot".to_string(),
46//! publication_name: "drasi_pub".to_string(),
47//! ssl_mode: SslMode::Disable,
48//! table_keys: vec![],
49//! };
50//! let provider = PostgresBootstrapProvider::new(config);
51//! ```
52
53pub mod config;
54pub mod postgres;
55
56pub use config::{PostgresBootstrapConfig, SslMode, TableKeyConfig};
57pub use postgres::{PostgresBootstrapProvider, PostgresBootstrapProviderBuilder};