sqlx_build_trust_core/
lib.rs

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// See `clippy.toml` at the workspace root
19#![deny(clippy::disallowed_method)]
20// The only unsafe code in SQLx is that necessary to interact with native APIs like with SQLite,
21// and that can live in its own separate driver crate.
22#![forbid(unsafe_code)]
23// Allows an API be documented as only available in some specific platforms.
24// <https://doc.rust-lang.org/unstable-book/language-features/doc-cfg.html>
25#![cfg_attr(docsrs, feature(doc_cfg))]
26
27#[macro_use]
28pub mod ext;
29
30#[macro_use]
31pub mod error;
32
33#[macro_use]
34pub mod arguments;
35
36#[macro_use]
37pub mod pool;
38
39pub mod connection;
40
41#[macro_use]
42pub mod transaction;
43
44#[macro_use]
45pub mod encode;
46
47#[macro_use]
48pub mod decode;
49
50#[macro_use]
51pub mod types;
52
53#[macro_use]
54pub mod query;
55
56#[macro_use]
57pub mod acquire;
58
59#[macro_use]
60pub mod column;
61
62#[macro_use]
63pub mod statement;
64
65pub mod common;
66pub mod database;
67pub mod describe;
68pub mod executor;
69pub mod from_row;
70pub mod fs;
71pub mod io;
72pub mod logger;
73pub mod net;
74pub mod query_as;
75pub mod query_builder;
76pub mod query_scalar;
77
78pub mod raw_sql;
79pub mod row;
80pub mod rt;
81pub mod sync;
82pub mod type_info;
83pub mod value;
84
85#[cfg(feature = "migrate")]
86pub mod migrate;
87
88#[cfg(feature = "any")]
89pub mod any;
90
91// Implements test support with automatic DB management.
92#[cfg(feature = "migrate")]
93pub mod testing;
94
95pub use error::{Error, Result};
96
97/// sqlx uses ahash for increased performance, at the cost of reduced DoS resistance.
98pub use ahash::AHashMap as HashMap;
99pub use either::Either;
100pub use indexmap::IndexMap;
101pub use percent_encoding;
102pub use smallvec::SmallVec;
103pub use url::{self, Url};
104
105pub use bytes;
106
107//type HashMap<K, V> = std::collections::HashMap<K, V, ahash::RandomState>;
108
109/// Helper module to get drivers compiling again that used to be in this crate,
110/// to avoid having to replace tons of `use crate::<...>` imports.
111///
112/// This module can be glob-imported and should not clash with any modules a driver
113/// would want to implement itself.
114pub mod driver_prelude {
115    pub use crate::{
116        acquire, common, decode, describe, encode, executor, ext, from_row, fs, io, logger, net,
117        pool, query, query_as, query_builder, query_scalar, rt, sync,
118    };
119
120    pub use crate::error::{Error, Result};
121    pub use crate::HashMap;
122    pub use either::Either;
123}