Skip to content

Commit

Permalink
Fixes sql delete and update limit (#557)
Browse files Browse the repository at this point in the history
The delete_stmt_limited and update_stmt_limited grammar uses the `expr` type, when used with bind parameters
the compiler cannot resolve the type in SqlDelight.

Change to use `limiting_term`, same as the compound_select_stmt

fixes #539
  • Loading branch information
griffio authored Sep 19, 2023
1 parent 5a493a1 commit ef3f8d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/kotlin/com/alecstrong/sql/psi/core/sql.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ delete_stmt ::= [ with_clause ] DELETE FROM qualified_table_name [ WHERE expr ]
mixin = "com.alecstrong.sql.psi.core.psi.mixins.MutatorMixin"
pin = 2
}
delete_stmt_limited ::= [ with_clause ] DELETE FROM qualified_table_name [ WHERE expr ] [ [ ORDER BY ordering_term ( COMMA ordering_term ) * ] LIMIT expr [ ( OFFSET | COMMA ) expr ] ] {
delete_stmt_limited ::= [ with_clause ] DELETE FROM qualified_table_name [ WHERE expr ] [ [ ORDER BY ordering_term ( COMMA ordering_term ) * ] LIMIT limiting_term [ ( OFFSET | COMMA ) expr ] ] {
mixin = "com.alecstrong.sql.psi.core.psi.mixins.MutatorMixin"
pin = 2
}
Expand Down Expand Up @@ -402,7 +402,7 @@ update_stmt_limited ::= [ with_clause ] UPDATE [ OR ROLLBACK | OR ABORT | OR REP
update_set_clause
[ WHERE expr ]
[ [ ORDER BY ordering_term ( COMMA ordering_term ) * ]
LIMIT expr [ ( OFFSET | COMMA ) expr ] ] {
LIMIT limiting_term [ ( OFFSET | COMMA ) expr ] ] {
mixin = "com.alecstrong.sql.psi.core.psi.mixins.MutatorMixin"
pin = 4
}
Expand Down

0 comments on commit ef3f8d3

Please sign in to comment.