Skip to main content

use_database/
lib.rs

1#![forbid(unsafe_code)]
2#![doc = include_str!("../README.md")]
3
4//! Thin facade for primitive database vocabulary crates.
5
6#[cfg(feature = "column")]
7pub use use_db_column as column;
8#[cfg(feature = "constraint")]
9pub use use_db_constraint as constraint;
10#[cfg(feature = "core")]
11pub use use_db_core as core;
12#[cfg(feature = "driver")]
13pub use use_db_driver as driver;
14#[cfg(feature = "index")]
15pub use use_db_index as index;
16#[cfg(feature = "key")]
17pub use use_db_key as key;
18#[cfg(feature = "migration")]
19pub use use_db_migration as migration;
20#[cfg(feature = "name")]
21pub use use_db_name as name;
22#[cfg(feature = "query")]
23pub use use_db_query as query;
24#[cfg(feature = "record")]
25pub use use_db_record as record;
26#[cfg(feature = "relation")]
27pub use use_db_relation as relation;
28#[cfg(feature = "result")]
29pub use use_db_result as result;
30#[cfg(feature = "row")]
31pub use use_db_row as row;
32#[cfg(feature = "schema")]
33pub use use_db_schema as schema;
34#[cfg(feature = "table")]
35pub use use_db_table as table;
36#[cfg(feature = "transaction")]
37pub use use_db_transaction as transaction;
38#[cfg(feature = "url")]
39pub use use_db_url as url;
40
41#[cfg(feature = "column")]
42pub use use_db_column::{
43    ColumnDefault, ColumnMetadata, ColumnOrdinal, ColumnRef, ColumnTypeLabel, Nullability,
44};
45#[cfg(feature = "constraint")]
46pub use use_db_constraint::{
47    CheckExpressionLabel, ConstraintKind, ConstraintMetadata, ConstraintRef, ConstraintStatus,
48    Deferrability,
49};
50#[cfg(feature = "core")]
51pub use use_db_core::{
52    DatabaseCapability, DatabaseDialect, DatabaseEngine, DatabaseError, DatabaseFeature,
53    DatabaseKind, DatabaseObjectKind, DatabaseResult, DatabaseVersion,
54};
55#[cfg(feature = "driver")]
56pub use use_db_driver::{
57    BackendFeature, BackendKind, BackendName, DriverCapability, DriverVersion,
58};
59#[cfg(feature = "index")]
60pub use use_db_index::{
61    IndexColumn, IndexKind, IndexMetadata, IndexOrder, IndexRef, IndexUniqueness,
62};
63#[cfg(feature = "key")]
64pub use use_db_key::{
65    CandidateKey, CompositeKey, ForeignKey, KeyColumn, KeyKind, PrimaryKey, UniqueKey,
66};
67#[cfg(feature = "migration")]
68pub use use_db_migration::{
69    MigrationAppliedAt, MigrationChecksum, MigrationDirection, MigrationId, MigrationPlan,
70    MigrationStatus, MigrationStep, MigrationVersion,
71};
72#[cfg(feature = "name")]
73pub use use_db_name::{
74    CollectionName, ColumnName, ConnectionName, ConstraintName, DatabaseName, DatabaseNameError,
75    DriverName, IndexName, MigrationName, PoolName, RelationName, SchemaName, TableName,
76};
77#[cfg(feature = "query")]
78pub use use_db_query::{
79    Cursor, FilterOperator, Limit, Offset, PageRequest, Projection, QueryKind, QueryLabel,
80    QueryMode, QueryTimeout, SortDirection, SortKey,
81};
82#[cfg(feature = "record")]
83pub use use_db_record::{RecordId, RecordKey, RecordRef, RecordStatus, RecordVersion};
84#[cfg(feature = "relation")]
85pub use use_db_relation::{Cardinality, RelationEndpoint, RelationKind, RelationRef, Relationship};
86#[cfg(feature = "result")]
87pub use use_db_result::{
88    CursorPosition, HasMore, PageInfo, ResultPage, ResultSet, ResultSetMetadata, TotalCount,
89};
90#[cfg(feature = "row")]
91pub use use_db_row::{AffectedRows, RowCount, RowId, RowNumber, RowStatus};
92#[cfg(feature = "schema")]
93pub use use_db_schema::{SchemaMetadata, SchemaNamespace, SchemaObject, SchemaRef, SchemaVersion};
94#[cfg(feature = "table")]
95pub use use_db_table::{TableKind, TableMetadata, TableRef, TableStats, TableStatus};
96#[cfg(feature = "transaction")]
97pub use use_db_transaction::{
98    TransactionBoundary, TransactionId, TransactionIsolation, TransactionMode, TransactionOutcome,
99    TransactionState,
100};
101#[cfg(feature = "url")]
102pub use use_db_url::{
103    DatabaseDsn, DatabaseHost, DatabasePath, DatabasePort, DatabaseScheme, DatabaseUrl,
104    DatabaseUrlParts,
105};
106
107/// Common database primitive re-exports.
108pub mod prelude {
109    #[cfg(feature = "column")]
110    pub use use_db_column::{ColumnMetadata, ColumnRef, ColumnTypeLabel, Nullability};
111    #[cfg(feature = "constraint")]
112    pub use use_db_constraint::{ConstraintKind, ConstraintMetadata, ConstraintRef, Deferrability};
113    #[cfg(feature = "core")]
114    pub use use_db_core::{DatabaseEngine, DatabaseKind, DatabaseObjectKind};
115    #[cfg(feature = "driver")]
116    pub use use_db_driver::{BackendKind, BackendName, DriverCapability, DriverVersion};
117    #[cfg(feature = "index")]
118    pub use use_db_index::{IndexColumn, IndexKind, IndexMetadata, IndexOrder, IndexRef};
119    #[cfg(feature = "key")]
120    pub use use_db_key::{ForeignKey, KeyColumn, PrimaryKey, UniqueKey};
121    #[cfg(feature = "migration")]
122    pub use use_db_migration::{MigrationDirection, MigrationId, MigrationPlan, MigrationStep};
123    #[cfg(feature = "name")]
124    pub use use_db_name::{ColumnName, DatabaseName, DriverName, SchemaName, TableName};
125    #[cfg(feature = "query")]
126    pub use use_db_query::{PageRequest, QueryKind, QueryMode, SortDirection, SortKey};
127    #[cfg(feature = "record")]
128    pub use use_db_record::{RecordId, RecordKey, RecordRef, RecordStatus};
129    #[cfg(feature = "relation")]
130    pub use use_db_relation::{Cardinality, RelationEndpoint, Relationship};
131    #[cfg(feature = "result")]
132    pub use use_db_result::{HasMore, ResultPage, ResultSet, TotalCount};
133    #[cfg(feature = "row")]
134    pub use use_db_row::{AffectedRows, RowCount, RowId, RowStatus};
135    #[cfg(feature = "schema")]
136    pub use use_db_schema::{SchemaMetadata, SchemaRef};
137    #[cfg(feature = "table")]
138    pub use use_db_table::{TableMetadata, TableRef, TableStats};
139    #[cfg(feature = "transaction")]
140    pub use use_db_transaction::{TransactionId, TransactionIsolation, TransactionMode};
141    #[cfg(feature = "url")]
142    pub use use_db_url::{DatabaseDsn, DatabaseUrl};
143}