Skip to content

Commit

Permalink
- releasing version 0.2.5
Browse files Browse the repository at this point in the history
- drop user
  • Loading branch information
julfikar committed Jun 6, 2023
1 parent 135eb9d commit b76d768
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "flql"
version = "0.2.4"
version = "0.2.5"
edition = "2021"
authors = ["Mohammad Julfikar <julfikar@eztech.com.my>", "Mohammad Julfikar <md.julfikar.mahmud@gmail.com>"]
categories = ["parser-implementations"]
Expand Down
2 changes: 2 additions & 0 deletions flql.pest
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ expr = {
new_db |
perm_db |
drop_db |
drop_user |
new |
drop |
exists |
Expand All @@ -30,6 +31,7 @@ expr = {
new_db = { "db"~"."~"new"~"("~db~")"~"."~"permit"~"("~object~")" }
perm_db = { "db"~"("~db~")"~"."~"permit"~"("~object~")" }
drop_db = { "db"~"("~db~")"~"."~"drop"~"("~")" }
drop_user = { "db"~"("~db~")"~"."~"user"~"("~quots~")"~"."~"drop"~"("~")" }

new = { "new" ~ "(" ~ object ~ ")" }
drop = { "drop" ~ "(" ~ collection ~ ")" }
Expand Down
16 changes: 13 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ use crate::exp_parser::BoxedExpression;
/// "exists('').into('');",
/// "length('');",
/// "put({}).into('');",
/// "put({}).when('prop.name == \"acv\" OR prop.name SW \"ac\"').into('');",
/// "put({}).when('prop.name == \"acv\" OR prop.name STARTS_WITH \"ac\"').into('');",
/// "put({}).pointer('').into('');",
/// "get.from('');",
/// "get.when('prop.name == \"acv\" OR prop.name SW \"ac\"').from('');",
/// "get.when('prop.name == \"acv\" OR prop.name STARTS_WITH \"ac\"').from('');",
/// "get.pointer('').from('');",
/// "get.view('').from('');",
/// "get.clip('').from('');",
/// "delete.from('');",
/// "delete.when('prop.name == \"acv\" OR prop.name SW \"ac\"').from('');",
/// "delete.when('prop.name == \"acv\" OR prop.name STARTS_WITH \"ac\"').from('');",
/// "delete.pointer('').from('');",
/// "delete.clip('').from('');"
/// ];
Expand All @@ -95,6 +95,7 @@ use crate::exp_parser::BoxedExpression;
/// Flql::DbDrop(_) => {}
/// Flql::New(_) => {}
/// Flql::Drop(_) => {}
/// Flql::DropUser(_,_) => {}
/// Flql::Exists(_,_) => {}
/// Flql::Length(_) => {}
/// Flql::Flush(_) => {}
Expand Down Expand Up @@ -455,6 +456,7 @@ pub enum Flql {
DbDrop(String),
New(String),
Drop(String),
DropUser(String, String),
Exists(String, String),
Length(String),
Flush(String),
Expand Down Expand Up @@ -497,6 +499,13 @@ fn pair_parser(pair: Pair<Rule>) -> Flql {
Rule::drop_db => {
Flql::DbDrop(one(pair).to_string())
}
Rule::drop_user => {
let two = two(pair);
Flql::DropUser(
two[0].to_string(),
two[1].to_string()
)
}
Rule::new => {
Flql::New(one(pair).to_string())
}
Expand Down Expand Up @@ -762,6 +771,7 @@ mod tests {
Flql::DbDrop(_) => {}
Flql::New(_) => {}
Flql::Drop(_) => {}
Flql::DropUser(_,_) => {}
Flql::Exists(_,_) => {}
Flql::Length(_) => {}
Flql::Flush(_) => {}
Expand Down

0 comments on commit b76d768

Please sign in to comment.