Skip to content
Snippets Groups Projects
Commit 753b482e authored by Maksim Kaitmazian's avatar Maksim Kaitmazian
Browse files

feat: support substr function

parent aced5eb3
No related branches found
No related tags found
1 merge request!1414sbroad import
......@@ -27,6 +27,7 @@ expression ::= ('NOT'* (
| to_char
| to_date
| trim
| substr
| '(' expression ')'
| 'NOT'? 'EXISTS' '(' (query | values) ')'
| '(' (query | values) ')'
......@@ -53,6 +54,7 @@ to_date ::= 'TO_DATE' '(' expression ',' format ')'
trim ::= 'TRIM' '('
((('LEADING' | 'TRAILING' | 'BOTH')? removal_chars
| ('LEADING' | 'TRAILING' | 'BOTH')) 'FROM')? string ')'
substr ::= 'SUBSTR' '(' string ',' from (',' count)? ')'
values ::= 'VALUES'
('(' (expression(',' expression)*) ')')
(',' ('(' (expression(',' expression)*) ')'))*
......
......@@ -77,6 +77,7 @@ pub fn get_builtin_functions() -> &'static [Function] {
vec![
Function::new_stable("\"TO_DATE\"".into(), Type::Datetime),
Function::new_stable("\"TO_CHAR\"".into(), Type::String),
Function::new_stable("\"SUBSTR\"".into(), Type::String),
]
})
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment