Skip to content

Commit

Permalink
update [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
benfdking committed Dec 17, 2024
1 parent f71b2fa commit 2de72cb
Showing 1 changed file with 31 additions and 54 deletions.
85 changes: 31 additions & 54 deletions crates/lib-dialects/src/databricks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ use sqruff_lib_core::{
dialects::{base::Dialect, init::DialectKind, syntax::SyntaxKind},
helpers::{Config, ToMatchable},
parser::{
grammar::{anyof::one_of, base::Ref, sequence::Sequence},
grammar::{
anyof::one_of,
base::Ref,
sequence::{Bracketed, Sequence},
},
lexer::Matcher,
},
vec_of_erased,
Expand Down Expand Up @@ -127,59 +131,28 @@ pub fn dialect() -> Dialect {
.to_matchable()
.into(),
),
// (
// "ForeignKeyOptionGrammar".into(),
// Sequence::new(vec_of_erased![
// Sequence::new(vec_of_erased![Ref::keyword("MATCH"), Ref::keyword("FULL"),])
// .config(|config| { config.optional() }),
// Sequence::new(vec_of_erased![
// Ref::keyword("ON"),
// Ref::keyword("UPDATE"),
// Ref::keyword("NO"),
// Ref::keyword("ACTION"),
// ])
// .config(|config| { config.optional() }),
// Sequence::new(vec_of_erased![
// Ref::keyword("ON"),
// Ref::keyword("DELETE"),
// Ref::keyword("NO"),
// Ref::keyword("ACTION"),
// ]),
// ]),
// ),
// // DropConstraintGrammar=Sequence(
// // "DROP",
// // OneOf(
// // Sequence(
// // Ref("PrimaryKeyGrammar"),
// // Ref("IfExistsGrammar", optional=True),
// // OneOf(
// // "RESTRICT",
// // "CASCADE",
// // optional=True,
// // ),
// // ),
// // Sequence(
// // Ref("ForeignKeyGrammar"),
// // Ref("IfExistsGrammar", optional=True),
// // Bracketed(
// // Delimited(
// // Ref("ColumnReferenceSegment"),
// // )
// // ),
// // ),
// // Sequence(
// // "CONSTRAINT",
// // Ref("IfExistsGrammar", optional=True),
// // Ref("ObjectReferenceSegment"),
// // OneOf(
// // "RESTRICT",
// // "CASCADE",
// // optional=True,
// // ),
// // ),
// // ),
// // ),
(
"ForeignKeyOptionGrammar".into(),
Sequence::new(vec_of_erased![
Sequence::new(vec_of_erased![Ref::keyword("MATCH"), Ref::keyword("FULL"),])
.config(|config| { config.optional() }),
Sequence::new(vec_of_erased![
Ref::keyword("ON"),
Ref::keyword("UPDATE"),
Ref::keyword("NO"),
Ref::keyword("ACTION"),
])
.config(|config| { config.optional() }),
Sequence::new(vec_of_erased![
Ref::keyword("ON"),
Ref::keyword("DELETE"),
Ref::keyword("NO"),
Ref::keyword("ACTION"),
]),
])
.to_matchable()
.into(),
),
// (
// "DropConstraintGrammar".into(),
// one_of(vec_of_erased![
Expand Down Expand Up @@ -227,6 +200,10 @@ pub fn dialect() -> Dialect {
// // ),
// // ),
// // ),
// (
// "AlterPropertyGrammar".into(),
// Bracketed
// )
// // RowFilterClauseGrammar=Sequence(
// // "ROW",
// // "FILTER",
Expand Down

0 comments on commit 2de72cb

Please sign in to comment.