| 1 |
//! Core of SQLx, the rust SQL toolkit. |
| 2 |
//! |
| 3 |
//! ### Note: Semver Exempt API |
| 4 |
//! The API of this crate is not meant for general use and does *not* follow Semantic Versioning. |
| 5 |
//! The only crate that follows Semantic Versioning in the project is the `sqlx` crate itself. |
| 6 |
//! If you are building a custom SQLx driver, you should pin an exact version for `sqlx-core` to |
| 7 |
//! avoid breakages: |
| 8 |
//! |
| 9 |
//! ```toml |
| 10 |
//! sqlx-core = { version = "=0.6.2" } |
| 11 |
//! ``` |
| 12 |
//! |
| 13 |
//! And then make releases in lockstep with `sqlx-core`. We recommend all driver crates, in-tree |
| 14 |
//! or otherwise, use the same version numbers as `sqlx-core` to avoid confusion. |
| 15 |
#![recursion_limit = "512"] |
| 16 |
#![warn(future_incompatible, rust_2018_idioms)] |
| 17 |
#![allow(clippy::needless_doctest_main, clippy::type_complexity)] |
| 18 |
// The only unsafe code in SQLx is that necessary to interact with native APIs like with SQLite, |
| 19 |
// and that can live in its own separate driver crate. |
| •20 |
//#![forbid(unsafe_code)] disabled due to async-io update. |
| 21 |
// Allows an API be documented as only available in some specific platforms. |
| 22 |
// <https://doc.rust-lang.org/unstable-book/language-features/doc-cfg.html> |
| 23 |
#![cfg_attr(docsrs, feature(doc_cfg))] |
| 24 |
|
| 25 |
#[macro_use] |
| 26 |
pub mod ext; |
| 27 |
|
| 28 |
#[macro_use] |
| 29 |
pub mod error; |
| 30 |
|
| 31 |
#[macro_use] |
| 32 |
pub mod arguments; |
| 33 |
|
| 34 |
#[macro_use] |
| 35 |
pub mod pool; |
| 36 |
|
| 37 |
pub mod connection; |
| 38 |
|
| 39 |
#[macro_use] |
| 40 |
pub mod transaction; |
| 41 |
|
| 42 |
#[macro_use] |
| 43 |
pub mod encode; |
| 44 |
|
| 45 |
#[macro_use] |
| 46 |
pub mod decode; |
| 47 |
|
| 48 |
#[macro_use] |
| 49 |
pub mod types; |
| 50 |
|
| 51 |
#[macro_use] |
| 52 |
pub mod query; |
| 53 |
|
| 54 |
#[macro_use] |
| 55 |
pub mod acquire; |
| 56 |
|
| 57 |
#[macro_use] |
| 58 |
pub mod column; |
| 59 |
|
| 60 |
#[macro_use] |
| 61 |
pub mod statement; |
| 62 |
|
| 63 |
pub mod common; |
| 64 |
pub mod database; |
| 65 |
pub mod describe; |
| 66 |
pub mod executor; |
| 67 |
pub mod from_row; |
| 68 |
pub mod fs; |
| 69 |
pub mod io; |
| 70 |
pub mod logger; |
| 71 |
pub mod net; |
| 72 |
pub mod query_as; |
| 73 |
pub mod query_builder; |
| 74 |
pub mod query_scalar; |
| 75 |
|
| 76 |
pub mod raw_sql; |
| 77 |
pub mod row; |
| 78 |
pub mod rt; |
| 79 |
pub mod sync; |
| 80 |
pub mod type_checking; |
| 81 |
pub mod type_info; |
| 82 |
pub mod value; |
| 83 |
|
| 84 |
#[cfg(feature = "migrate")] |
| 85 |
pub mod migrate; |
| 86 |
|
| 87 |
#[cfg(feature = "any")] |
| 88 |
pub mod any; |
| 89 |
|
| 90 |
// Implements test support with automatic DB management. |
| 91 |
#[cfg(feature = "migrate")] |
| 92 |
pub mod testing; |
| 93 |
|
| 94 |
pub use error::{Error, Result}; |
| 95 |
|
| 96 |
pub use either::Either; |
| 97 |
pub use hashbrown::{hash_map, HashMap}; |
| 98 |
pub use indexmap::IndexMap; |
| 99 |
pub use percent_encoding; |
| 100 |
pub use smallvec::SmallVec; |
| 101 |
pub use url::{self, Url}; |
| 102 |
|
| 103 |
pub use bytes; |
| 104 |
|
| 105 |
/// Helper module to get drivers compiling again that used to be in this crate, |
| 106 |
/// to avoid having to replace tons of `use crate::<...>` imports. |
| 107 |
/// |
| 108 |
/// This module can be glob-imported and should not clash with any modules a driver |
| 109 |
/// would want to implement itself. |
| 110 |
pub mod driver_prelude { |
| 111 |
pub use crate::{ |
| 112 |
acquire, common, decode, describe, encode, executor, ext, from_row, fs, io, logger, net, |
| 113 |
pool, query, query_as, query_builder, query_scalar, rt, sync, |
| 114 |
}; |
| 115 |
|
| 116 |
pub use crate::error::{Error, Result}; |
| 117 |
pub use crate::{hash_map, HashMap}; |
| 118 |
pub use either::Either; |
| 119 |
} |