reallyme_foundationdb_kit/lib.rs
1// SPDX-FileCopyrightText: Copyright © 2026 ReallyMe LLC. All rights reserved
2//
3// SPDX-License-Identifier: MIT OR Apache-2.0
4
5#![deny(missing_docs)]
6#![deny(unsafe_code, clippy::unwrap_used, clippy::expect_used, clippy::panic)]
7
8//! FoundationDB primitives for ReallyMe services.
9//!
10//! This kit owns the reusable FoundationDB connection, configuration, typed
11//! errors, transaction policy, retry policy, tuple/key encoding boundary,
12//! key namespace/prefix validation, range scan helpers, key metadata, and
13//! tenant-scoped access.
14//!
15//! Tenants are the segmentation primitive that higher-level schemas build on.
16//! The kit validates neutral tenant names, opens tenant-scoped FoundationDB
17//! handles, and fails closed if a tenant has not been provisioned. Applications
18//! own the mapping from their domain concepts to these infrastructure names.
19//!
20//! No async-graphql, axum, or HTTP client code belongs here.
21
22/// FoundationDB connector, transactions, tenants, and low-level primitives.
23pub mod fdb;
24/// Validated key construction helpers shared by FoundationDB adapters.
25pub mod keys;
26
27pub use fdb::config::{FdbConfig, FdbConfigInput};
28pub use fdb::connector::{FdbContext, FdbHealthReport, FoundationDbConnector};
29pub use fdb::error::{
30 ConfigErrorReason, ConfigField, FdbError, FdbHealthErrorReason, FdbQueryErrorReason, FdbResult,
31 FdbSetupErrorReason, TenantErrorReason, TenantMetadataField,
32};
33pub use fdb::startup::{verify_ready, verify_tenants_provisioned};
34pub use fdb::tenant::TenantHandle;
35pub use fdb::tenant_name::{
36 FoundationDbTenantName, FoundationDbTenantNameError, FoundationDbTenantNameErrorReason,
37 MAX_FOUNDATIONDB_TENANT_NAME_LENGTH,
38};