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// Connectors are Ring 1 (cold path): std HashMap/HashSet are acceptable
8// throughout config, registry, schema, checkpoint, and CDC modules.
9#![allow(clippy::disallowed_types)]
10// Common test patterns that are acceptable
11#![cfg_attr(
12    test,
13    allow(
14        clippy::field_reassign_with_default,
15        clippy::float_cmp,
16        clippy::manual_let_else,
17        clippy::needless_return,
18        clippy::unreadable_literal,
19        clippy::approx_constant,
20        clippy::cast_possible_truncation,
21        clippy::cast_possible_wrap,
22        clippy::cast_sign_loss,
23        clippy::cast_precision_loss,
24        clippy::no_effect_underscore_binding,
25        unused_mut
26    )
27)]
28
29// ── Connector SDK ──
30
31/// Connector error types.
32pub mod error;
33
34#[macro_use]
35mod macros;
36
37/// Connector configuration types.
38pub mod config;
39
40/// Core connector traits (`SourceConnector`, `SinkConnector`).
41pub mod connector;
42pub mod generator;
43
44/// Connector checkpoint types.
45pub mod checkpoint;
46
47/// Reconnect/backoff helper shared across source connectors.
48pub mod retry;
49
50/// Shared Prometheus registry/counter helpers used by per-connector
51/// metric structs.
52pub mod prom;
53
54/// Record serialization and deserialization framework.
55pub mod serde;
56
57/// Schema inference, resolution, and evolution framework.
58pub mod schema;
59
60/// Connector registry with factory pattern.
61pub mod registry;
62
63/// Engine-controlled partition → vnode ownership for partitioned sources
64/// (Kafka). Pure mapping logic, ungated so it builds and is tested without a
65/// native Kafka/OpenSSL toolchain.
66pub mod partition_assignment;
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/// Change Data Capture connectors for databases.
79pub mod cdc;
80
81/// PostgreSQL sink connector.
82#[cfg(feature = "postgres-sink")]
83pub mod postgres;
84
85/// Lookup table support for enrichment joins.
86pub mod lookup;
87
88/// Lakehouse connectors (Delta Lake, Iceberg).
89pub mod lakehouse;
90
91/// Sink-agnostic changelog collapse for upsert sinks (Z-set / CDC → key-unique
92/// `_op` batch). Pulled in by upsert-capable sink features (e.g. `delta-lake`).
93#[cfg(feature = "changelog-collapse")]
94pub mod changelog;
95
96/// Cloud storage infrastructure (credential resolution, validation, secret masking).
97pub mod storage;
98
99/// Reference table source trait and refresh modes.
100pub mod reference;
101
102/// WebSocket source and sink connectors.
103#[cfg(feature = "websocket")]
104pub mod websocket;
105
106/// MongoDB CDC source and sink connectors.
107#[cfg(feature = "mongodb-cdc")]
108pub mod mongodb;
109
110/// OpenTelemetry OTLP/gRPC source connector.
111#[cfg(feature = "otel")]
112pub mod otel;
113
114/// NATS core and JetStream source and sink connectors.
115#[cfg(feature = "nats")]
116pub mod nats;
117
118/// AutoLoader-style file source and sink connectors.
119#[cfg(feature = "files")]
120#[allow(
121    clippy::similar_names,
122    clippy::cast_possible_truncation,
123    clippy::must_use_candidate,
124    clippy::items_after_statements,
125    clippy::manual_let_else,
126    clippy::missing_fields_in_debug,
127    clippy::unnecessary_wraps,
128    clippy::case_sensitive_file_extension_comparisons,
129    clippy::map_unwrap_or,
130    clippy::unnecessary_literal_bound,
131    clippy::too_many_lines
132)]
133pub mod files;