Query parser 3.0 (#23)

* Starting query parsing

* Query parser

* working config

* disable by default

* fix tsets

* introducing log crate; test for query router; comments

* typo

* fixes for banning

* added test for prepared stmt
This commit is contained in:
Lev Kokotov
2022-02-18 07:10:18 -08:00
committed by GitHub
parent 4c8a3987fe
commit aa796289bf
8 changed files with 296 additions and 75 deletions

View File

@@ -13,6 +13,24 @@ pub enum Role {
Replica,
}
impl PartialEq<Option<Role>> for Role {
fn eq(&self, other: &Option<Role>) -> bool {
match other {
None => true,
Some(role) => *self == *role,
}
}
}
impl PartialEq<Role> for Option<Role> {
fn eq(&self, other: &Role) -> bool {
match *self {
None => true,
Some(role) => role == *other,
}
}
}
#[derive(Clone, PartialEq, Hash, std::cmp::Eq, Debug)]
pub struct Address {
pub host: String,
@@ -47,6 +65,8 @@ pub struct Shard {
#[derive(Deserialize, Debug, Clone)]
pub struct QueryRouter {
pub default_role: String,
pub query_parser_enabled: bool,
pub primary_reads_enabled: bool,
}
#[derive(Deserialize, Debug, Clone)]