Skip to main content

shelly_data/
lib.rs

1//! Shelly data-layer primitives.
2//!
3//! This crate is intentionally transport-agnostic and DB-driver-agnostic.
4//! It provides:
5//! - schema metadata
6//! - changeset casting/validation
7//! - repo traits + an in-memory adapter abstraction
8//! - query composition primitives
9//! - migration loading/state application helpers
10
11mod adapter;
12mod app_services;
13mod async_repo;
14mod changeset;
15mod error;
16mod integrations;
17mod migration;
18mod query;
19mod repo;
20mod schema;
21
22pub use adapter::{AdapterKind, DatabaseConfig};
23pub use app_services::{
24    map_app_service_error, map_app_service_result, AppServiceError, AppServiceErrorKind,
25    AppServiceResult, AuthCredentials, AuthIdentity, AuthSession, BackgroundJobHandle,
26    BackgroundJobRequest, BackgroundJobService, BackgroundJobState, BackgroundJobStatus,
27    CacheBackend, CacheEntry, EmailMessage, EmailReceipt, IdentityService, InMemoryCacheBackend,
28    InMemoryIdentityService, InMemoryQueueBackend, InMemoryTransactionalEmailService,
29    JobOrchestratorBackgroundJobs, QueueBackend, QueueMessage, TenantBackgroundJobQuota,
30    TenantQuotaBackgroundJobs, TransactionalEmailService,
31};
32pub use async_repo::{
33    AsyncCancellationToken, AsyncMemoryRepo, AsyncQueryContext, AsyncRepo, AsyncRepoFuture,
34};
35pub use changeset::{Changeset, ValidationError};
36pub use error::{DataError, DataResult};
37pub use integrations::{
38    map_integration_error, map_integration_result, query_from_search,
39    run_adapter_conformance_suite, run_with_contract, run_with_contract_async, run_with_retry,
40    run_with_retry_async, AdapterCallContract, AdapterConformanceCheck, AdapterConformanceReport,
41    AnalyticsEvent, AnalyticsSink, AxiomTelemetryBridge, BigQueryAdapter, ClickHouseAdapter,
42    ConnectionLifecycle, ConnectionLifecycleHook, DataWindowRequest, DataWindowResponse,
43    InMemoryAxiomSink, InMemoryBigQueryAdapter, InMemoryClickHouseAdapter, InMemoryJobOrchestrator,
44    InMemoryOpenSearchAdapter, InMemorySingleStoreAdapter, IntegrationError, IntegrationErrorKind,
45    IntegrationResult, JobCompletionCallback, JobHandle, JobOrchestrator, JobRequest, JobState,
46    JobStatus, LifecycleHooks, OpenSearchAdapter, QueryContext, RetryPolicy, SearchRequest,
47    SearchResponse, SingleStoreAdapter, SqlCommand, TriggerDevAdapter, TypedQueryBoundary,
48    CONTEXT_TAG_CORRELATION_ID, CONTEXT_TAG_REQUEST_ID, CONTEXT_TAG_RETRY_INITIAL_BACKOFF_MS,
49    CONTEXT_TAG_RETRY_MAX_ATTEMPTS, CONTEXT_TAG_RETRY_MAX_BACKOFF_MS, CONTEXT_TAG_TIMEOUT_MS,
50};
51pub use migration::{
52    load_migrations, AppliedMigration, Migration, MigrationEngine, MigrationStatus,
53};
54pub use query::{
55    Filter, FilterOperator, KeysetCursor, KeysetDirection, KeysetPagination, Pagination, Query,
56    QueryWindow, Sort, SortDirection, WindowToken, WireFormatProfile,
57};
58pub use repo::{
59    adapter_for, AdapterDriver, BigQueryDriver, ClickHouseDriver, CompactRowsPayload,
60    IncrementalDiff, MemoryRepo, MySqlAdapter, OpenSearchAdapterDriver, PostgresAdapter, Repo, Row,
61    SingleStoreDriver, SqliteAdapter, StoredRow, TenantPolicyContext, TenantPolicyDecision,
62    TenantPolicyHook, TenantRepoConfig, TenantRepoOperation, TenantScopedRepo, WindowPage,
63};
64pub use schema::{Field, FieldType, Schema, SchemaDefinition};