feat: add DECLARE parsing for mssql (#1235)

This commit is contained in:
WeblWabl 2024-05-01 05:51:04 -05:00 committed by GitHub
parent 4aa37a46a9
commit 5b83c73e38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 160 additions and 1 deletions

View file

@ -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}")
}