mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-11 06:22:04 +00:00
feat: add DECLARE parsing for mssql (#1235)
This commit is contained in:
parent
4aa37a46a9
commit
5b83c73e38
3 changed files with 160 additions and 1 deletions
|
@ -1566,6 +1566,14 @@ pub enum DeclareAssignment {
|
|||
/// DECLARE c1 CURSOR FOR res
|
||||
/// ```
|
||||
For(Box<Expr>),
|
||||
|
||||
/// Expression via the `=` syntax.
|
||||
///
|
||||
/// Example:
|
||||
/// ```sql
|
||||
/// DECLARE @variable AS INT = 100
|
||||
/// ```
|
||||
MsSqlAssignment(Box<Expr>),
|
||||
}
|
||||
|
||||
impl fmt::Display for DeclareAssignment {
|
||||
|
@ -1580,6 +1588,9 @@ impl fmt::Display for DeclareAssignment {
|
|||
DeclareAssignment::DuckAssignment(expr) => {
|
||||
write!(f, ":= {expr}")
|
||||
}
|
||||
DeclareAssignment::MsSqlAssignment(expr) => {
|
||||
write!(f, "= {expr}")
|
||||
}
|
||||
DeclareAssignment::For(expr) => {
|
||||
write!(f, "FOR {expr}")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue