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 changeset;
14mod error;
15mod integrations;
16mod migration;
17mod query;
18mod repo;
19mod schema;
20
21pub use adapter::{AdapterKind, DatabaseConfig};
22pub use app_services::{
23    map_app_service_error, map_app_service_result, AppServiceError, AppServiceErrorKind,
24    AppServiceResult, AuthCredentials, AuthIdentity, AuthSession, BackgroundJobHandle,
25    BackgroundJobRequest, BackgroundJobService, BackgroundJobState, BackgroundJobStatus,
26    CacheBackend, CacheEntry, EmailMessage, EmailReceipt, IdentityService, InMemoryCacheBackend,
27    InMemoryIdentityService, InMemoryQueueBackend, InMemoryTransactionalEmailService,
28    JobOrchestratorBackgroundJobs, QueueBackend, QueueMessage, TransactionalEmailService,
29};
30pub use changeset::{Changeset, ValidationError};
31pub use error::{DataError, DataResult};
32pub use integrations::{
33    map_integration_error, map_integration_result, query_from_search,
34    run_adapter_conformance_suite, run_with_contract, run_with_retry, AdapterCallContract,
35    AdapterConformanceCheck, AdapterConformanceReport, AnalyticsEvent, AnalyticsSink,
36    AxiomTelemetryBridge, ConnectionLifecycle, ConnectionLifecycleHook, InMemoryAxiomSink,
37    InMemoryJobOrchestrator, InMemoryOpenSearchAdapter, InMemorySingleStoreAdapter,
38    IntegrationError, IntegrationErrorKind, IntegrationResult, JobCompletionCallback, JobHandle,
39    JobOrchestrator, JobRequest, JobState, JobStatus, LifecycleHooks, OpenSearchAdapter,
40    QueryContext, RetryPolicy, SearchRequest, SearchResponse, SingleStoreAdapter, SqlCommand,
41    TriggerDevAdapter, TypedQueryBoundary, CONTEXT_TAG_CORRELATION_ID, CONTEXT_TAG_REQUEST_ID,
42    CONTEXT_TAG_RETRY_INITIAL_BACKOFF_MS, CONTEXT_TAG_RETRY_MAX_ATTEMPTS,
43    CONTEXT_TAG_RETRY_MAX_BACKOFF_MS, CONTEXT_TAG_TIMEOUT_MS,
44};
45pub use migration::{
46    load_migrations, AppliedMigration, Migration, MigrationEngine, MigrationStatus,
47};
48pub use query::{Filter, FilterOperator, Pagination, Query, Sort, SortDirection};
49pub use repo::{
50    adapter_for, AdapterDriver, MemoryRepo, MySqlAdapter, PostgresAdapter, Repo, Row,
51    SqliteAdapter, StoredRow,
52};
53pub use schema::{Field, FieldType, Schema, SchemaDefinition};