mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-30 10:47:22 +00:00
Implement ON CONFLICT and RETURNING (#666)
* Implement RETURNING on INSERT/UPDATE/DELETE * Implement INSERT ... ON CONFLICT * Fix tests * cargo fmt * tests: on conflict and returning Co-authored-by: gamife <gamife9886@gmail.com>
This commit is contained in:
parent
ae1c69034e
commit
814367a6ab
6 changed files with 250 additions and 8 deletions
|
@ -195,6 +195,7 @@ fn parse_update_with_table_alias() {
|
|||
assignments,
|
||||
from: _from,
|
||||
selection,
|
||||
returning,
|
||||
} => {
|
||||
assert_eq!(
|
||||
TableWithJoins {
|
||||
|
@ -231,6 +232,7 @@ fn parse_update_with_table_alias() {
|
|||
}),
|
||||
selection
|
||||
);
|
||||
assert_eq!(None, returning);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
@ -278,6 +280,7 @@ fn parse_where_delete_statement() {
|
|||
table_name,
|
||||
using,
|
||||
selection,
|
||||
returning,
|
||||
} => {
|
||||
assert_eq!(
|
||||
TableFactor::Table {
|
||||
|
@ -298,6 +301,7 @@ fn parse_where_delete_statement() {
|
|||
},
|
||||
selection.unwrap(),
|
||||
);
|
||||
assert_eq!(None, returning);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
@ -313,6 +317,7 @@ fn parse_where_delete_with_alias_statement() {
|
|||
table_name,
|
||||
using,
|
||||
selection,
|
||||
returning,
|
||||
} => {
|
||||
assert_eq!(
|
||||
TableFactor::Table {
|
||||
|
@ -353,6 +358,7 @@ fn parse_where_delete_with_alias_statement() {
|
|||
},
|
||||
selection.unwrap(),
|
||||
);
|
||||
assert_eq!(None, returning);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue