drizzle_core/
lib.rs

1//! Drizzle Core - SQL generation library
2//!
3//! # no_std Support
4//!
5//! This crate supports `no_std` environments with an allocator:
6//!
7//! ```toml
8//! # With std (default)
9//! drizzle-core = "0.1"
10//!
11//! # no_std with allocator
12//! drizzle-core = { version = "0.1", default-features = false, features = ["alloc"] }
13//! ```
14
15#![cfg_attr(not(feature = "std"), no_std)]
16
17#[cfg(feature = "alloc")]
18extern crate alloc;
19
20// Prelude for std/alloc compatibility
21pub(crate) mod prelude {
22    #[cfg(feature = "std")]
23    pub use std::{
24        borrow::Cow,
25        boxed::Box,
26        collections::HashMap,
27        format,
28        string::{String, ToString},
29        vec::Vec,
30    };
31
32    #[cfg(all(feature = "alloc", not(feature = "std")))]
33    pub use alloc::{
34        borrow::Cow,
35        boxed::Box,
36        format,
37        string::{String, ToString},
38        vec::Vec,
39    };
40
41    // For no_std, use hashbrown with default hasher
42    #[cfg(all(feature = "alloc", not(feature = "std")))]
43    pub use hashbrown::HashMap;
44}
45
46pub mod conversions;
47pub mod error;
48pub mod expressions;
49pub mod helpers;
50pub mod param;
51pub mod placeholder;
52pub mod prepared;
53#[cfg(feature = "profiling")]
54pub mod profiling;
55pub mod query;
56pub mod schema;
57pub mod sql;
58pub mod traits;
59
60// Re-export key types and traits
61pub use conversions::ToSQL;
62pub use param::{OwnedParam, Param, ParamBind};
63pub use placeholder::*;
64pub use query::*;
65pub use schema::OrderBy;
66pub use sql::{OwnedSQL, OwnedSQLChunk, SQL, SQLChunk, Token};
67pub use traits::*;