Skip to main content

reallyme_foundationdb_kit/
lib.rs

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