Hide more things
This commit is contained in:
parent
9a1073aae2
commit
dc28318a3f
63
src/enums.rs
63
src/enums.rs
@ -1,63 +0,0 @@
|
||||
//! Common enums
|
||||
|
||||
/// The position of the wildcard(s)
|
||||
/// for a `like` clause
|
||||
#[derive(Debug)]
|
||||
pub enum LikeWildcard {
|
||||
/// Wildcard before search term
|
||||
/// eg. `%foo`
|
||||
Before,
|
||||
|
||||
/// Wildcard after the search term
|
||||
/// eg. `foo%`
|
||||
After,
|
||||
|
||||
/// Wildcards surrounding the search term
|
||||
/// eg. `%foo%`
|
||||
Both,
|
||||
}
|
||||
|
||||
/// The type of SQL join
|
||||
#[derive(Debug)]
|
||||
pub enum JoinType {
|
||||
/// A `CROSS` join
|
||||
Cross,
|
||||
/// An `INNER` join
|
||||
Inner,
|
||||
/// An `OUTER` join
|
||||
Outer,
|
||||
/// A `LEFT (OUTER)` join
|
||||
Left,
|
||||
/// A `RIGHT (OUTER)` join
|
||||
Right,
|
||||
}
|
||||
|
||||
/// The sort direction
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum OrderDirection {
|
||||
/// Sort Ascending
|
||||
Asc,
|
||||
/// Sort Descending
|
||||
Desc,
|
||||
/// Random Sort (Not yet implemented!)
|
||||
Rand,
|
||||
}
|
||||
|
||||
/// The type of Query Clause
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum QueryClauseType {
|
||||
/// Ending a parenthetical grouping
|
||||
GroupEnd,
|
||||
/// Starting a parenthetical grouping
|
||||
GroupStart,
|
||||
/// A having clause
|
||||
Having,
|
||||
/// A join clause
|
||||
Join,
|
||||
/// A like clause
|
||||
Like,
|
||||
/// A where clause
|
||||
Where,
|
||||
/// A where in clause
|
||||
WhereIn,
|
||||
}
|
@ -17,7 +17,6 @@
|
||||
extern crate lazy_static;
|
||||
|
||||
pub mod drivers;
|
||||
pub mod enums;
|
||||
pub mod fns;
|
||||
pub mod query_builder;
|
||||
|
||||
@ -27,8 +26,12 @@ pub mod prelude {
|
||||
//! This includes enum types, traits,
|
||||
//! the Query Builder, and individual database drivers.
|
||||
pub use crate::drivers::DatabaseDriver;
|
||||
pub use crate::enums::*;
|
||||
pub use crate::query_builder::QueryBuilder;
|
||||
pub use crate::query_builder::{
|
||||
LikeWildcard,
|
||||
JoinType,
|
||||
OrderDirection,
|
||||
QueryBuilder
|
||||
};
|
||||
|
||||
#[cfg(feature = "postgres")]
|
||||
/// Postgres Driver
|
||||
|
@ -5,11 +5,72 @@ use std::any::Any;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::drivers::{DatabaseDriver, DefaultDriver};
|
||||
use crate::enums::*;
|
||||
use crate::fns::split_map_join;
|
||||
|
||||
use regex::Regex;
|
||||
|
||||
/// The position of the wildcard(s)
|
||||
/// for a `like` clause
|
||||
#[derive(Debug)]
|
||||
pub enum LikeWildcard {
|
||||
/// Wildcard before search term
|
||||
/// eg. `%foo`
|
||||
Before,
|
||||
|
||||
/// Wildcard after the search term
|
||||
/// eg. `foo%`
|
||||
After,
|
||||
|
||||
/// Wildcards surrounding the search term
|
||||
/// eg. `%foo%`
|
||||
Both,
|
||||
}
|
||||
|
||||
/// The type of SQL join
|
||||
#[derive(Debug)]
|
||||
pub enum JoinType {
|
||||
/// A `CROSS` join
|
||||
Cross,
|
||||
/// An `INNER` join
|
||||
Inner,
|
||||
/// An `OUTER` join
|
||||
Outer,
|
||||
/// A `LEFT (OUTER)` join
|
||||
Left,
|
||||
/// A `RIGHT (OUTER)` join
|
||||
Right,
|
||||
}
|
||||
|
||||
/// The sort direction
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum OrderDirection {
|
||||
/// Sort Ascending
|
||||
Asc,
|
||||
/// Sort Descending
|
||||
Desc,
|
||||
/// Random Sort (Not yet implemented!)
|
||||
Rand,
|
||||
}
|
||||
|
||||
/// The type of Query Clause
|
||||
#[derive(Debug, PartialEq)]
|
||||
enum QueryClauseType {
|
||||
/// Ending a parenthetical grouping
|
||||
GroupEnd,
|
||||
/// Starting a parenthetical grouping
|
||||
GroupStart,
|
||||
/// A having clause
|
||||
Having,
|
||||
/// A join clause
|
||||
Join,
|
||||
/// A like clause
|
||||
Like,
|
||||
/// A where clause
|
||||
Where,
|
||||
/// A where in clause
|
||||
WhereIn,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
enum QueryType {
|
||||
Select,
|
||||
|
Loading…
Reference in New Issue
Block a user