Skip to main content

drasi_bootstrap_mssql/
lib.rs

1#![allow(unexpected_cfgs)]
2// Copyright 2025 The Drasi Authors.
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//     http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16//! Microsoft SQL Server Bootstrap Provider for Drasi
17//!
18//! This provider reads initial data snapshots from MS SQL Server tables
19//! to bootstrap continuous queries before CDC streaming begins.
20//!
21//! # Example
22//!
23//! ```no_run
24//! use drasi_bootstrap_mssql::MsSqlBootstrapProvider;
25//!
26//! # fn example() -> anyhow::Result<()> {
27//! let provider = MsSqlBootstrapProvider::builder()
28//!     .with_host("localhost")
29//!     .with_database("production")
30//!     .with_user("drasi_user")
31//!     .with_password("secure_password")
32//!     .with_tables(vec!["orders".to_string()])
33//!     .build()?;
34//! # Ok(())
35//! # }
36//! ```
37
38pub mod descriptor;
39pub mod mssql;
40
41pub use drasi_mssql_common::{AuthMode, EncryptionMode, MsSqlSourceConfig, TableKeyConfig};
42pub use mssql::{MsSqlBootstrapProvider, MsSqlBootstrapProviderBuilder};
43
44/// Dynamic plugin entry point.
45///
46/// Dynamic plugin entry point.
47#[cfg(feature = "dynamic-plugin")]
48drasi_plugin_sdk::export_plugin!(
49    plugin_id = "mssql-bootstrap",
50    core_version = env!("CARGO_PKG_VERSION"),
51    lib_version = env!("CARGO_PKG_VERSION"),
52    plugin_version = env!("CARGO_PKG_VERSION"),
53    source_descriptors = [],
54    reaction_descriptors = [],
55    bootstrap_descriptors = [descriptor::MsSqlBootstrapDescriptor],
56);