Merge branch 'main' into no-whitespace-parser

This commit is contained in:
Luca 2025-11-14 16:55:25 +01:00
commit 9cd94c5f1b
19 changed files with 1455 additions and 157 deletions

View file

@ -2178,13 +2178,11 @@ fn parse_ampersand_arobase() {
#[test]
fn parse_pg_unary_ops() {
let pg_unary_ops = &[
("~", UnaryOperator::PGBitwiseNot),
("|/", UnaryOperator::PGSquareRoot),
("||/", UnaryOperator::PGCubeRoot),
("!!", UnaryOperator::PGPrefixFactorial),
("@", UnaryOperator::PGAbs),
];
for (str_op, op) in pg_unary_ops {
let select = pg().verified_only_select(&format!("SELECT {}a", &str_op));
assert_eq!(
@ -5176,6 +5174,7 @@ fn test_simple_postgres_insert_with_alias() {
assert_eq!(
statement,
Statement::Insert(Insert {
insert_token: AttachedToken::empty(),
or: None,
ignore: false,
into: true,
@ -5205,6 +5204,7 @@ fn test_simple_postgres_insert_with_alias() {
source: Some(Box::new(Query {
with: None,
body: Box::new(SetExpr::Values(Values {
value_keyword: false,
explicit_row: false,
rows: vec![vec![
Expr::Identifier(Ident::new("DEFAULT")),
@ -5245,6 +5245,7 @@ fn test_simple_postgres_insert_with_alias() {
assert_eq!(
statement,
Statement::Insert(Insert {
insert_token: AttachedToken::empty(),
or: None,
ignore: false,
into: true,
@ -5274,6 +5275,7 @@ fn test_simple_postgres_insert_with_alias() {
source: Some(Box::new(Query {
with: None,
body: Box::new(SetExpr::Values(Values {
value_keyword: false,
explicit_row: false,
rows: vec![vec![
Expr::Identifier(Ident::new("DEFAULT")),
@ -5316,6 +5318,7 @@ fn test_simple_insert_with_quoted_alias() {
assert_eq!(
statement,
Statement::Insert(Insert {
insert_token: AttachedToken::empty(),
or: None,
ignore: false,
into: true,
@ -5345,6 +5348,7 @@ fn test_simple_insert_with_quoted_alias() {
source: Some(Box::new(Query {
with: None,
body: Box::new(SetExpr::Values(Values {
value_keyword: false,
explicit_row: false,
rows: vec![vec![
Expr::Identifier(Ident::new("DEFAULT")),
@ -6256,7 +6260,7 @@ fn parse_create_type_as_enum() {
match statement {
Statement::CreateType {
name,
representation: UserDefinedTypeRepresentation::Enum { labels },
representation: Some(UserDefinedTypeRepresentation::Enum { labels }),
} => {
assert_eq!("public.my_type", name.to_string());
assert_eq!(