SQL-standard niladic functions: written without parentheses. Parsers emit them as bare identifiers; we promote them to function calls so they fold to a value at plan time instead of resolving to a column.
(name: &str)
| 20 | /// emit them as bare identifiers; we promote them to function calls so |
| 21 | /// they fold to a value at plan time instead of resolving to a column. |
| 22 | fn is_zero_arg_keyword_function(name: &str) -> bool { |
| 23 | matches!( |
| 24 | name, |
| 25 | "current_timestamp" |
| 26 | | "current_date" |
| 27 | | "current_time" |
| 28 | | "localtime" |
| 29 | | "localtimestamp" |
| 30 | | "current_user" |
| 31 | | "current_role" |
| 32 | | "current_schema" |
| 33 | | "session_user" |
| 34 | | "user" |
| 35 | ) |
| 36 | } |
| 37 | |
| 38 | /// Convert a sqlparser `Expr` to our `SqlExpr`. |
| 39 | pub fn convert_expr(expr: &Expr) -> Result<SqlExpr> { |
no outgoing calls
no test coverage detected