mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-30 10:47:22 +00:00
add support for insert into ... select ... returning ...
(#1132)
This commit is contained in:
parent
a5ac425f46
commit
d59b6638fa
2 changed files with 20 additions and 0 deletions
|
@ -225,6 +225,25 @@ fn parse_insert_default_values() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_insert_select_returning() {
|
||||
verified_stmt("INSERT INTO t SELECT 1 RETURNING 2");
|
||||
let stmt = verified_stmt("INSERT INTO t SELECT x RETURNING x AS y");
|
||||
match stmt {
|
||||
Statement::Insert {
|
||||
returning: Some(ret),
|
||||
source: Some(_),
|
||||
..
|
||||
} => assert_eq!(ret.len(), 1),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_returning_as_column_alias() {
|
||||
verified_stmt("SELECT 1 AS RETURNING");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_insert_sqlite() {
|
||||
let dialect = SQLiteDialect {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue