mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-11 22:42:02 +00:00
Parse SUBSTRING
FROM
syntax in all dialects, reflect change in the AST (#1173)
This commit is contained in:
parent
929c646bba
commit
6b03a259aa
7 changed files with 47 additions and 95 deletions
|
@ -559,13 +559,18 @@ pub enum Expr {
|
|||
/// ```sql
|
||||
/// SUBSTRING(<expr> [FROM <expr>] [FOR <expr>])
|
||||
/// ```
|
||||
/// or
|
||||
/// ```sql
|
||||
/// SUBSTRING(<expr>, <expr>, <expr>)
|
||||
/// ```
|
||||
Substring {
|
||||
expr: Box<Expr>,
|
||||
substring_from: Option<Box<Expr>>,
|
||||
substring_for: Option<Box<Expr>>,
|
||||
|
||||
// Some dialects use `SUBSTRING(expr [FROM start] [FOR len])` syntax while others omit FROM,
|
||||
// FOR keywords (e.g. Microsoft SQL Server). This flags is used for formatting.
|
||||
/// false if the expression is represented using the `SUBSTRING(expr [FROM start] [FOR len])` syntax
|
||||
/// true if the expression is represented using the `SUBSTRING(expr, start, len)` syntax
|
||||
/// This flag is used for formatting.
|
||||
special: bool,
|
||||
},
|
||||
/// ```sql
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue