stringqb/src/lib.rs

54 rader
1.4 KiB
Rust

//! # StringQB
//!
//! A query builder using mostly strings, with methods following common SQL syntax
//!
//!
//! ```no_run
//! use stringqb::prelude::*;
//!
//! // Create a QueryBuilder object, with the chosen database driver
//! let mut qb = QueryBuilder::new(PostgresDriver::new("postgresql://user@localhost"));
//!
//! ```
//!
//! Drivers include:
//! * `PostgresDriver` - for PostgreSQL databases
//! * `MySQLDriver` - for MySQL/MariaDB databases
//! * `SQLiteDriver` - for SQLite databases
#![warn(missing_docs)]
#[macro_use]
extern crate lazy_static;
#[cfg(feature = "sqlite")]
#[macro_use]
extern crate slite;
pub mod drivers;
pub mod fns;
pub mod query_builder;
pub mod types;
pub mod prelude {
//! Re-exports important traits and types.
//!
//! This includes enum types, traits,
//! the Query Builder, and individual database drivers.
pub use crate::drivers::DatabaseDriver;
pub use crate::query_builder::{JoinType, LikeWildcard, OrderDirection, QueryBuilder};
#[cfg(feature = "postgres")]
/// Postgres Driver
pub use crate::drivers::postgres::PostgresDriver;
#[cfg(feature = "sqlite")]
/// SQLite Driver
pub use crate::drivers::sqlite::SQLiteDriver;
#[cfg(feature = "mysql")]
/// MySQL Driver
pub use crate::drivers::mysql::MySQLDriver;
// MSSQL is missing on purpose, as it is not a real priority to actually implement
}