Skip to main content

dbrest_core/
lib.rs

1//! dbrest-core — database-agnostic core for the dbrest REST API
2//!
3//! This crate provides the core traits, query generation, API handling,
4//! authentication, configuration, and schema cache logic. It does not
5//! contain any database-specific code (e.g. no sqlx, no PostgreSQL).
6
7#![cfg_attr(test, allow(clippy::field_reassign_with_default))]
8#![cfg_attr(test, allow(clippy::const_is_empty))]
9#![cfg_attr(test, allow(clippy::unnecessary_get_then_check))]
10
11pub mod api_request;
12pub mod app;
13pub mod auth;
14pub mod backend;
15pub mod config;
16pub mod error;
17pub mod openapi;
18pub mod plan;
19pub mod query;
20pub mod routing;
21pub mod schema_cache;
22pub mod types;
23
24// Test helpers (only available in test builds)
25#[cfg(test)]
26pub mod test_helpers;
27
28// Re-export commonly used types
29pub use api_request::ApiRequest;
30pub use app::{AppState, Datasource, DbrestApp, DbrestRouters, start_server};
31pub use auth::{AuthResult, AuthState, JwtCache};
32pub use backend::{DatabaseBackend, DbVersion, PoolStatus, SqlDialect};
33pub use config::{AppConfig, load_config};
34pub use error::Error;
35pub use plan::action_plan;
36pub use routing::{LocalRouter, NamespaceId, Route, Router, RoutingError};
37pub use schema_cache::{SchemaCache, SchemaCacheHolder};
38pub use types::identifiers::{QualifiedIdentifier, RelIdentifier};
39pub use types::media::MediaType;