GQL
GQL copied to clipboard
Incorrect statement for CASE in documentation
Describe the bug
Incorrect statement for CASE in documentation
To Reproduce
// https://github.com/AmrDeveloper/GQL/blob/master/docs/expression/case.md
SELECT name FROM branches WHERE (CASE WHERE isRemote THEN 1 ELSE 0 END) > 0
Expected behavior
SELECT name FROM branches WHERE (CASE WHEN isRemote THEN 1 ELSE 0 END) > 0 // replace WHERE with WHEN
GQL (please complete the following information):
Version 0.13.0
Screenshots
Please check parser.rs @AmrDeveloper
https://github.com/AmrDeveloper/GQL/blob/f9d61c979d25fbafaa8fe99836efc3140e239cad/crates/gitql-parser/src/parser.rs#L1868C20-L1868C23
// Check if current token kind is WHEN keyword`
let when_result = consume_kind(tokens, *position, TokenKind::When);
if when_result.is_err() {
return Err(Diagnostic::error("Expect `when` before case condition")
.add_help("Try to add `WHEN` keyword before any condition")
.with_location(get_safe_location(tokens, *position))
.as_boxed());
}
Hello @craftslab,
Thank you for reporting,i fixed it and docs is correct no
Thank you, Amr