faucet_source_spanner/lib.rs
1#![cfg_attr(docsrs, feature(doc_cfg))]
2//! Google Cloud Spanner query source connector for
3//! [faucet-stream](https://crates.io/crates/faucet-stream).
4//!
5//! Runs a GoogleSQL query against a Spanner database via the streaming read
6//! API (`ExecuteStreamingSql`) and emits rows as JSON with bounded memory.
7//! Supports named bind parameters, stale reads, incremental replication via
8//! a monotonic column bookmark, live dataset discovery
9//! (`INFORMATION_SCHEMA`), and PK-range sharding for clustered execution.
10//!
11//! ```yaml
12//! source:
13//! kind: spanner
14//! config:
15//! project_id: my-project
16//! instance: my-instance
17//! database: my-db
18//! query: "SELECT * FROM orders WHERE updated_at > TIMESTAMP(@bookmark)"
19//! replication:
20//! type: incremental
21//! column: updated_at
22//! initial_value: "1970-01-01T00:00:00Z"
23//! ```
24//!
25//! Authentication defaults to Application Default Credentials; a service
26//! account key can be supplied by path or inline via `auth`. Set
27//! `emulator_host` to target the Spanner emulator.
28
29mod config;
30mod stream;
31
32pub use config::{ShardConfig, SpannerReplication, SpannerSourceConfig};
33pub use faucet_common_spanner::{SpannerConnection, SpannerCredentials};
34pub use stream::SpannerSource;