1
8021
//! The root crate of the `Canyon-SQL` project.
2
///
3
/// Here it's where all the available functionalities and features
4
/// reaches the top most level, grouping them and making them visible
5
/// through this crate, building the *public API* of the library
6
extern crate canyon_connection;
7
extern crate canyon_crud;
8
extern crate canyon_macros;
9
#[cfg(feature = "migrations")]
10
extern crate canyon_migrations;
11

            
12
/// Reexported elements to the root of the public API
13
#[cfg(feature = "migrations")]
14
pub mod migrations {
15
    pub use canyon_migrations::migrations::{handler, processor};
16
}
17

            
18
/// The top level reexport. Here we define the path to some really important
19
/// things in `Canyon-SQL`, like the `main` macro, the IT macro.
20
pub use canyon_macros::main;
21

            
22
/// Public API for the `Canyon-SQL` proc-macros, and for the external ones
23
pub mod macros {
24
56
    pub use canyon_crud::async_trait::*;
25
    pub use canyon_macros::*;
26
56
}
27

            
28
/// connection module serves to reexport the public elements of the `canyon_connection` crate,
29
/// exposing them through the public API
30
pub mod connection {
31
    #[cfg(feature = "postgres")]
32
    pub use canyon_connection::canyon_database_connector::DatabaseConnection::Postgres;
33

            
34
    #[cfg(feature = "mssql")]
35
    pub use canyon_connection::canyon_database_connector::DatabaseConnection::SqlServer;
36

            
37
    #[cfg(feature = "mysql")]
38
    pub use canyon_connection::canyon_database_connector::DatabaseConnection::MySQL;
39
}
40

            
41
/// Crud module serves to reexport the public elements of the `canyon_crud` crate,
42
/// exposing them through the public API
43
pub mod crud {
44
336
    pub use canyon_crud::bounds;
45
56
    pub use canyon_crud::crud::*;
46
    pub use canyon_crud::mapper::*;
47
    pub use canyon_crud::rows::CanyonRows;
48
    pub use canyon_crud::DatabaseType;
49
}
50

            
51
56
/// Re-exports the query elements from the `crud`crate
52
112
pub mod query {
53
112
    pub use canyon_crud::query_elements::operators;
54
112
    pub use canyon_crud::query_elements::{query::*, query_builder::*};
55
56
}
56

            
57
56
/// Reexport the available database clients within Canyon
58
448
pub mod db_clients {
59
    #[cfg(feature = "mysql")]
60
56
    pub use canyon_connection::mysql_async;
61
    #[cfg(feature = "mssql")]
62
360
    pub use canyon_connection::tiberius;
63
360
    #[cfg(feature = "postgres")]
64
    pub use canyon_connection::tokio_postgres;
65
56
}
66
56

            
67
56
/// Reexport the needed runtime dependencies
68
636
pub mod runtime {
69
1052
    pub use canyon_connection::futures;
70
692
    pub use canyon_connection::init_connections_cache;
71
996
    pub use canyon_connection::tokio;
72
692
    pub use canyon_connection::tokio_util;
73
56
    pub use canyon_connection::CANYON_TOKIO_RUNTIME;
74
}
75

            
76
56
/// Module for reexport the `chrono` crate with the allowed public and available types in Canyon
77
56
pub mod date_time {
78
    pub use canyon_crud::chrono::{
79
        DateTime, FixedOffset, NaiveDate, NaiveDateTime, NaiveTime, Utc,
80
    };
81
}