MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / is_zero_arg_keyword_function

Function is_zero_arg_keyword_function

nodedb-sql/src/resolver/expr/convert.rs:22–36  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
22fn 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`.
39pub fn convert_expr(expr: &Expr) -> Result<SqlExpr> {

Callers 1

convert_expr_innerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected