Skip to main content

type_bridge/
lib.rs

1//! Public Rust client library for TypeBridge.
2//!
3//! Provides top-level [`Database`], [`ConnectionOptions`], [`SchemaPackage`],
4//! and owner-branded schema/model primitives.
5
6#![forbid(unsafe_code)]
7#![deny(missing_docs)]
8
9extern crate self as type_bridge;
10
11pub mod __codegen;
12pub mod aggregate;
13mod canonical_codec;
14#[allow(dead_code)]
15mod entity_codec;
16mod entity_manager;
17pub mod error;
18pub mod hooks;
19pub mod migration;
20pub mod model;
21mod projected_batch;
22mod projected_codec;
23mod projected_filter;
24mod query;
25#[allow(dead_code)]
26mod relation_codec;
27mod relation_manager;
28mod remote;
29pub mod schema;
30pub mod session;
31mod transaction;
32pub mod value;
33
34pub use canonical_codec::{CanonicalCodecLimits, CanonicalCodecOptions};
35pub use entity_manager::{EntityManager, EntitySubtypeManager};
36pub use error::{
37    Error, ErrorCategory, ErrorDetail, ErrorDiagnostic, ErrorPathSegment, ModelValidationPhase,
38    QueryDiagnosticCategory, QueryDiagnosticPathKind, Result,
39};
40pub use hooks::{
41    CrudOperation, HookContext, HookError, HookFuture, LifecycleHook, ModelKind, PreHookResult,
42};
43pub use migration::{
44    MigrationApprovalBuilder, MigrationApprovalSet, MigrationCatalog, MigrationHistoryEntry,
45    MigrationPlan, MigrationPreview, MigrationPreviewEntry,
46};
47pub use projected_filter::{
48    ProjectedEntityFilter, ProjectedRelationFilter, ReadEntityManager, ReadRelationManager,
49};
50pub use query::{
51    Binding, BoundField, BoundRole, Collected, Exact, FieldGroupedQuery, FunctionArgument,
52    FunctionCall, FunctionInput, FunctionScalarArgument, GroupedQuery, NamedSelection, Order,
53    OrderedOperand, Page, PageOptions, Predicate, Query, QueryOperand, QuerySession, RowsOptions,
54    Selectable, SelectedRowSpec, SelectedShape, SelectedSlot, SelectionMode, SingularSelectedShape,
55    Subtypes,
56};
57pub use relation_manager::{RelationManager, RelationSubtypeManager};
58pub use remote::{
59    RemoteConnectionOptions, RemoteDatabase, RemoteQueryLimits, RemoteQueryTransport,
60};
61pub use schema::{Schema, SchemaPackage, Unbound};
62pub use session::{ConnectionOptions, Database, DatabaseCreateOutcome, DatabaseDeleteOutcome};
63#[cfg(feature = "typedb")]
64pub use session::{
65    ManagedDatabaseDeleteOutcome, ManagedDatabaseDeletionPlan, ManagedDatabasePairState,
66};
67pub use transaction::{
68    ReadTransaction, TransactionEntityManager, TransactionRelationManager, WriteTransaction,
69};
70pub use type_bridge_orm::{
71    AnswerCancellation, MAX_QUERY_ATTRIBUTE_VALUES, MAX_QUERY_BYTES, MAX_QUERY_COLLECTION_MEMBERS,
72    MAX_QUERY_GRAPH_NODES, MAX_QUERY_ITEMS, MAX_QUERY_ROLE_PLAYERS, MAX_QUERY_STATEMENTS,
73    MAX_QUERY_TIMEOUT_MILLISECONDS, ProjectedManagerComparison, QueryExecutionDeadline,
74    QueryExecutionResourceLimits,
75};
76#[cfg(feature = "typedb")]
77pub use type_bridge_orm::{DirectConnectionPolicy, DirectTls};
78pub use type_bridge_orm_derive::SelectedRow;
79#[cfg(feature = "typedb")]
80pub use type_bridge_schema_migration::{
81    MAX_MIGRATION_BACKFILL_OBSERVATIONS, MAX_MIGRATION_EXECUTION_GROUPS,
82    MigrationBackfillObservation, MigrationCancellation, MigrationDriftFinding,
83    MigrationExecutionControl, MigrationExecutionDirection, MigrationExecutionReport,
84    MigrationExecutionReportPosition, MigrationExecutionResourceLimits, MigrationExecutionStatus,
85    MigrationVerifyReport,
86};