mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-10 05:52:13 +00:00
Add support for UPDATE ... LIMIT ...
(#1991)
Some checks are pending
license / Release Audit Tool (RAT) (push) Waiting to run
Rust / codestyle (push) Waiting to run
Rust / lint (push) Waiting to run
Rust / benchmark-lint (push) Waiting to run
Rust / compile (push) Waiting to run
Rust / docs (push) Waiting to run
Rust / compile-no-std (push) Waiting to run
Rust / test (beta) (push) Waiting to run
Rust / test (nightly) (push) Waiting to run
Rust / test (stable) (push) Waiting to run
Some checks are pending
license / Release Audit Tool (RAT) (push) Waiting to run
Rust / codestyle (push) Waiting to run
Rust / lint (push) Waiting to run
Rust / benchmark-lint (push) Waiting to run
Rust / compile (push) Waiting to run
Rust / docs (push) Waiting to run
Rust / compile-no-std (push) Waiting to run
Rust / test (beta) (push) Waiting to run
Rust / test (nightly) (push) Waiting to run
Rust / test (stable) (push) Waiting to run
This commit is contained in:
parent
67fca82495
commit
27544f9343
6 changed files with 36 additions and 1 deletions
|
@ -3238,6 +3238,8 @@ pub enum Statement {
|
|||
returning: Option<Vec<SelectItem>>,
|
||||
/// SQLite-specific conflict resolution clause
|
||||
or: Option<SqliteOnConflict>,
|
||||
/// LIMIT
|
||||
limit: Option<Expr>,
|
||||
},
|
||||
/// ```sql
|
||||
/// DELETE
|
||||
|
@ -4810,6 +4812,7 @@ impl fmt::Display for Statement {
|
|||
selection,
|
||||
returning,
|
||||
or,
|
||||
limit,
|
||||
} => {
|
||||
f.write_str("UPDATE ")?;
|
||||
if let Some(or) = or {
|
||||
|
@ -4843,6 +4846,10 @@ impl fmt::Display for Statement {
|
|||
f.write_str("RETURNING")?;
|
||||
indented_list(f, returning)?;
|
||||
}
|
||||
if let Some(limit) = limit {
|
||||
SpaceOrNewline.fmt(f)?;
|
||||
write!(f, "LIMIT {limit}")?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Statement::Delete(delete) => delete.fmt(f),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue