app.cash.sqldelight.dialects.sqlite_3_25.grammar.sqlite.bnf Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sqlite-3-25-dialect Show documentation
Show all versions of sqlite-3-25-dialect Show documentation
The SQLite v3.25 Dialect for SQLDelight
The newest version!
{
// Specify the parent parser.
overrides="com.alecstrong.sql.psi.core.SqlParser"
elementTypeClass = "com.alecstrong.sql.psi.core.SqlElementType"
implements="com.alecstrong.sql.psi.core.psi.SqlCompositeElement"
extends="com.alecstrong.sql.psi.core.psi.SqlCompositeElementImpl"
psiClassPrefix = "Sqlite"
parserImports=[
"static com.alecstrong.sql.psi.core.psi.SqlTypes.ALL"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.AND"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.AS"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.BETWEEN"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.BY"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.COLUMN"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.COMMA"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.DISTINCT"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.DOT"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.FROM"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.GROUP"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.HAVING"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.ID"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.LP"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.MULTIPLY"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.NO"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.ORDER"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.PARTITION"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.RENAME"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.ROW"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.RP"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.SELECT"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.TO"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.VALUES"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.WHERE"
"static com.alecstrong.sql.psi.core.psi.SqlTypes.WINDOW"
]
}
overrides ::= alter_table_rules | result_column | select_stmt
alter_table_rules ::= (
{alter_table_add_column}
| {alter_table_rename_table}
| alter_table_rename_column
) {
extends = "com.alecstrong.sql.psi.core.psi.impl.SqlAlterTableRulesImpl"
implements = "com.alecstrong.sql.psi.core.psi.SqlAlterTableRules"
override = true
}
result_column ::= ( MULTIPLY
| {table_name} DOT MULTIPLY
| (window_function_invocation | <>) [ [ AS ] {column_alias} ] ) {
mixin = "app.cash.sqldelight.dialects.sqlite_3_25.grammar.mixins.ResultColumnMixin"
implements = "com.alecstrong.sql.psi.core.psi.SqlResultColumn"
override = true
}
select_stmt ::= SELECT [ DISTINCT | ALL ] {result_column} ( COMMA {result_column} ) * [ FROM {join_clause} ] [ WHERE <> ] [{group_by}] [ HAVING <> ] [ WINDOW window_name AS window_defn ( COMMA window_name AS window_defn ) * ] | VALUES {values_expression} ( COMMA {values_expression} ) * {
extends = "com.alecstrong.sql.psi.core.psi.impl.SqlSelectStmtImpl"
implements = "com.alecstrong.sql.psi.core.psi.SqlSelectStmt"
override = true
pin = 1
}
alter_table_rename_column ::= RENAME [ COLUMN ] {column_name} TO alter_table_column_alias {
mixin = "app.cash.sqldelight.dialects.sqlite_3_25.grammar.mixins.AlterTableRenameColumnMixin"
pin = 1
}
alter_table_column_alias ::= id | string {
mixin = "app.cash.sqldelight.dialects.sqlite_3_25.grammar.mixins.AlterTableColumnAliasMixin"
implements = [
"com.alecstrong.sql.psi.core.psi.AliasElement";
"com.alecstrong.sql.psi.core.psi.NamedElement";
"com.alecstrong.sql.psi.core.psi.SqlCompositeElement"
"com.alecstrong.sql.psi.core.psi.SqlColumnName"
]
}
window_function_invocation ::=
window_func LP [ MULTIPLY | ( <> ( COMMA <> ) * ) ] RP [ 'FILTER' LP WHERE <> RP] 'OVER' ( window_defn | window_name ) {
pin = 6
}
window_defn ::= LP [ base_window_name ]
[ PARTITION BY <> ( COMMA <> ) * ]
[ ORDER BY {ordering_term} ( COMMA {ordering_term} ) * ]
[ frame_spec ]
RP {
mixin = "app.cash.sqldelight.dialects.sqlite_3_25.grammar.mixins.SqliteWindowDefinitionMixin"
}
frame_spec ::= ( 'RANGE' | 'ROWS' | 'GROUPS' )
(
BETWEEN (
'UNBOUNDED' 'PRECEDING' |
'CURRENT' ROW |
<> 'PRECEDING' |
<> 'FOLLOWING'
) AND (
'UNBOUNDED' 'FOLLOWING' |
'CURRENT' ROW |
<> 'PRECEDING' |
<> 'FOLLOWING'
) |
'UNBOUNDED' 'PRECEDING' |
'CURRENT' ROW |
<> 'PRECEDING'
) [ 'EXCLUDE' NO 'OTHERS' | 'EXCLUDE' 'CURRENT' ROW | 'EXCLUDE' GROUP | 'EXCLUDE' 'TIES' ] {
pin = 1
}
window_func ::= id
window_name ::= id
base_window_name ::= id