Skip to content

Commit 60fbac1

Browse files
committed
Added more sql keywords to colorize method
1 parent 4b1fe41 commit 60fbac1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description = "Write SQL queries in a simple and composable way"
44
documentation = "https://docs.rs/sql_query_builder"
55
repository = "https://github.com/belchior/sql_query_builder"
66
authors = ["Belchior Oliveira <[email protected]>"]
7-
version = "0.7.4"
7+
version = "0.8.4"
88
edition = "2021"
99
license = "MIT"
1010
keywords = ["sql", "query", "postgres"]

src/fmt.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ impl<'a> Formatter<'a> {
2626
}
2727

2828
pub fn colorize(sql: String) -> String {
29-
let keywords: [(fn(&str) -> String, &str, &str); 38] = [
29+
let keywords: [(fn(&str) -> String, &str, &str); 41] = [
30+
(blue, "CROSS ", "cross "),
31+
(blue, "DELETE ", "delete "),
3032
(blue, "EXCEPT ", "except "),
31-
(blue, "CROSS ", "cros "),
3233
(blue, "FROM ", "from "),
3334
(blue, "FULL ", "full "),
3435
(blue, "GROUP ", "group "),
@@ -45,7 +46,9 @@ pub fn colorize(sql: String) -> String {
4546
(blue, "OVERRIDING ", "overriding "),
4647
(blue, "RIGHT ", "right "),
4748
(blue, "SELECT ", "select "),
49+
(blue, "SET ", "set "),
4850
(blue, "UNION ", "union "),
51+
(blue, "UPDATE ", "update "),
4952
(blue, "VALUES ", "values "),
5053
(blue, "WHERE ", "where "),
5154
(blue, "WITH ", "with "),

0 commit comments

Comments
 (0)