Skip to main content

laminar_connectors/
lib.rs

1//! `LaminarDB` connector framework.
2
3#![deny(missing_docs)]
4#![warn(clippy::all, clippy::pedantic)]
5#![allow(clippy::duration_suboptimal_units)] // MSRV 1.85; from_mins/from_hours are 1.91+
6#![allow(clippy::module_name_repetitions)]
7#![allow(clippy::too_many_arguments, clippy::too_many_lines)]
8// Connector protocols keep explicit inputs and contiguous state transitions.
9// Connectors are Ring 1 (cold path): std HashMap/HashSet are acceptable
10// throughout config, registry, schema, checkpoint, and CDC modules.
11#![allow(clippy::disallowed_types)]
12// Common test patterns that are acceptable
13#![cfg_attr(
14    test,
15    allow(
16        clippy::field_reassign_with_default,
17        clippy::float_cmp,
18        clippy::manual_let_else,
19        clippy::needless_return,
20        clippy::unreadable_literal,
21        clippy::approx_constant,
22        clippy::cast_possible_truncation,
23        clippy::cast_possible_wrap,
24        clippy::cast_sign_loss,
25        clippy::cast_precision_loss,
26        clippy::no_effect_underscore_binding,
27        unused_mut
28    )
29)]
30
31// ── Connector SDK ──
32
33/// Connector error types.
34pub mod error;
35
36#[macro_use]
37mod macros;
38
39/// Connector configuration types.
40pub mod config;
41
42/// Secret classification and durable connector-identity sanitization.
43pub mod security;
44
45/// Core connector traits (`SourceConnector`, `SinkConnector`).
46pub mod connector;
47pub mod generator;
48
49/// Connector checkpoint types.
50pub mod checkpoint;
51
52/// Reconnect/backoff helper shared across source connectors.
53pub mod retry;
54
55/// Shared Prometheus registry/counter helpers used by per-connector
56/// metric structs.
57pub mod prom;
58
59/// Record serialization and deserialization framework.
60pub mod serde;
61
62/// Schema inference, resolution, and evolution framework.
63pub mod schema;
64
65/// Connector registry with factory pattern.
66pub mod registry;
67
68/// Testing utilities (mock connectors, helpers).
69#[cfg(any(test, feature = "testing"))]
70pub mod testing;
71
72// ── Existing Modules ──
73
74/// Kafka source and sink connectors.
75#[cfg(feature = "kafka")]
76pub mod kafka;
77
78/// PostgreSQL connector-specific configuration and implementations.
79#[cfg(any(feature = "postgres-cdc", feature = "postgres-sink"))]
80pub mod postgres;
81
82/// Lakehouse connectors (Delta Lake, Iceberg).
83pub mod lakehouse;
84
85/// Sink-agnostic changelog collapse for upsert sinks (Z-set / CDC → key-unique
86/// `_op` batch). Pulled in by upsert-capable sink features (e.g. `delta-lake`).
87#[cfg(feature = "changelog-collapse")]
88pub mod changelog;
89
90/// Cloud storage infrastructure (credential resolution, validation, secret masking).
91pub mod storage;
92
93/// Finite startup snapshot sources for reference tables.
94pub mod reference;
95
96/// WebSocket source and sink connectors.
97#[cfg(feature = "websocket")]
98pub mod websocket;
99
100/// MongoDB CDC source and sink connectors.
101#[cfg(feature = "mongodb-cdc")]
102pub mod mongodb;
103
104/// OpenTelemetry OTLP/gRPC source connector.
105#[cfg(feature = "otel")]
106pub mod otel;
107
108/// NATS core and JetStream source and sink connectors.
109#[cfg(feature = "nats")]
110pub mod nats;
111
112/// AutoLoader-style file source and sink connectors.
113#[cfg(feature = "files")]
114#[allow(
115    clippy::similar_names,
116    clippy::cast_possible_truncation,
117    clippy::must_use_candidate,
118    clippy::items_after_statements,
119    clippy::manual_let_else,
120    clippy::missing_fields_in_debug,
121    clippy::unnecessary_wraps,
122    clippy::case_sensitive_file_extension_comparisons,
123    clippy::map_unwrap_or,
124    clippy::unnecessary_literal_bound,
125    clippy::too_many_lines
126)]
127pub mod files;