program:

top_level_stmts

program  ::= top_level_stmts

no references


top_level_stmts:

include_section stmt_list

top_level_stmts
         ::= include_section* stmt_list?

referenced by:


include_section:

@INCLUDE quoted-filename top_level_stmts end of included file

include_section
         ::= '@INCLUDE quoted-filename' top_level_stmts 'end of included file'

referenced by:


opt_stmt_list:

stmt_list

opt_stmt_list
         ::= stmt_list?

referenced by:


non_expr_macro_ref:

stmt_list_macro_ref cte_tables_macro_ref select_core_macro_ref select_expr_macro_ref query_parts_macro_ref

non_expr_macro_ref
         ::= stmt_list_macro_ref
           | cte_tables_macro_ref
           | select_core_macro_ref
           | select_expr_macro_ref
           | query_parts_macro_ref

referenced by:


stmt_list_macro_ref:

ID! ( opt_macro_args )

stmt_list_macro_ref
         ::= 'ID!' ( '(' opt_macro_args ')' )?

referenced by:


expr_macro_ref:

basic_expr : ID! ( opt_macro_args )

expr_macro_ref
         ::= ( basic_expr ':' )? 'ID!' ( '(' opt_macro_args ')' )?

referenced by:


query_parts_macro_ref:

ID! ( opt_macro_args )

query_parts_macro_ref
         ::= 'ID!' ( '(' opt_macro_args ')' )?

referenced by:


cte_tables_macro_ref:

ID! ( opt_macro_args )

cte_tables_macro_ref
         ::= 'ID!' ( '(' opt_macro_args ')' )?

referenced by:


select_core_macro_ref:

ID! ( opt_macro_args )

select_core_macro_ref
         ::= 'ID!' ( '(' opt_macro_args ')' )?

referenced by:


select_expr_macro_ref:

ID! ( opt_macro_args )

select_expr_macro_ref
         ::= 'ID!' ( '(' opt_macro_args ')' )?

referenced by:


stmt_list:

stmt stmt_list_macro_ref ;

stmt_list
         ::= ( stmt | stmt_list_macro_ref ';' )+

referenced by:


stmt:

misc_attrs any_stmt ;

stmt     ::= misc_attrs any_stmt ';'

referenced by:


expr_stmt:

expr

expr_stmt
         ::= expr

referenced by:


any_stmt:

alter_table_add_column_stmt expr_stmt begin_schema_region_stmt begin_trans_stmt blob_get_key_type_stmt blob_get_val_type_stmt blob_get_key_stmt blob_get_val_stmt blob_create_key_stmt blob_create_val_stmt blob_update_key_stmt blob_update_val_stmt call_stmt close_stmt commit_return_stmt commit_trans_stmt const_stmt CONTINUE create_index_stmt create_proc_stmt create_table_stmt create_trigger_stmt create_view_stmt create_virtual_table_stmt declare_deployable_region_stmt declare_enum_stmt declare_const_stmt declare_group_stmt declare_func_stmt declare_select_func_stmt declare_out_call_stmt declare_proc_no_check_stmt declare_proc_stmt declare_interface_stmt declare_schema_region_stmt declare_vars_stmt declare_forward_read_cursor_stmt declare_fetched_value_cursor_stmt declare_type_stmt delete_stmt drop_index_stmt drop_table_stmt drop_trigger_stmt drop_view_stmt echo_stmt emit_enums_stmt emit_group_stmt emit_constants_stmt @END_SCHEMA_REGION enforce_normal_stmt @ENFORCE_POP @ENFORCE_PUSH @ENFORCE_RESET enforce_strict_stmt explain_stmt select_nothing_stmt fetch_call_stmt fetch_stmt fetch_values_stmt fetch_cursor_from_blob_stmt guard_stmt if_stmt insert_stmt LEAVE let_stmt loop_stmt macro_def_stmt op_stmt out_stmt out_union_stmt out_union_parent_child_stmt @PREVIOUS_SCHEMA proc_savepoint_stmt release_savepoint_stmt RETURN rollback_return_stmt rollback_trans_stmt savepoint_stmt select_stmt schema_ad_hoc_migration_stmt schema_unsub_stmt @SCHEMA_UPGRADE_SCRIPT schema_upgrade_version_stmt set_stmt switch_stmt THROW trycatch_stmt update_cursor_stmt update_stmt upsert_stmt while_stmt with_delete_stmt with_insert_stmt with_update_stmt with_upsert_stmt @KEEP_TABLE_NAME_IN_ALIASES

any_stmt ::= alter_table_add_column_stmt
           | expr_stmt
           | begin_schema_region_stmt
           | begin_trans_stmt
           | blob_get_key_type_stmt
           | blob_get_val_type_stmt
           | blob_get_key_stmt
           | blob_get_val_stmt
           | blob_create_key_stmt
           | blob_create_val_stmt
           | blob_update_key_stmt
           | blob_update_val_stmt
           | call_stmt
           | close_stmt
           | commit_return_stmt
           | commit_trans_stmt
           | const_stmt
           | 'CONTINUE'
           | create_index_stmt
           | create_proc_stmt
           | create_table_stmt
           | create_trigger_stmt
           | create_view_stmt
           | create_virtual_table_stmt
           | declare_deployable_region_stmt
           | declare_enum_stmt
           | declare_const_stmt
           | declare_group_stmt
           | declare_func_stmt
           | declare_select_func_stmt
           | declare_out_call_stmt
           | declare_proc_no_check_stmt
           | declare_proc_stmt
           | declare_interface_stmt
           | declare_schema_region_stmt
           | declare_vars_stmt
           | declare_forward_read_cursor_stmt
           | declare_fetched_value_cursor_stmt
           | declare_type_stmt
           | delete_stmt
           | drop_index_stmt
           | drop_table_stmt
           | drop_trigger_stmt
           | drop_view_stmt
           | echo_stmt
           | emit_enums_stmt
           | emit_group_stmt
           | emit_constants_stmt
           | '@END_SCHEMA_REGION'
           | enforce_normal_stmt
           | '@ENFORCE_POP'
           | '@ENFORCE_PUSH'
           | '@ENFORCE_RESET'
           | enforce_strict_stmt
           | explain_stmt
           | select_nothing_stmt
           | fetch_call_stmt
           | fetch_stmt
           | fetch_values_stmt
           | fetch_cursor_from_blob_stmt
           | guard_stmt
           | if_stmt
           | insert_stmt
           | 'LEAVE'
           | let_stmt
           | loop_stmt
           | macro_def_stmt
           | op_stmt
           | out_stmt
           | out_union_stmt
           | out_union_parent_child_stmt
           | '@PREVIOUS_SCHEMA'
           | proc_savepoint_stmt
           | release_savepoint_stmt
           | 'RETURN'
           | rollback_return_stmt
           | rollback_trans_stmt
           | savepoint_stmt
           | select_stmt
           | schema_ad_hoc_migration_stmt
           | schema_unsub_stmt
           | '@SCHEMA_UPGRADE_SCRIPT'
           | schema_upgrade_version_stmt
           | set_stmt
           | switch_stmt
           | 'THROW'
           | trycatch_stmt
           | update_cursor_stmt
           | update_stmt
           | upsert_stmt
           | while_stmt
           | with_delete_stmt
           | with_insert_stmt
           | with_update_stmt
           | with_upsert_stmt
           | '@KEEP_TABLE_NAME_IN_ALIASES'

referenced by:


explain_stmt:

EXPLAIN opt_query_plan explain_target

explain_stmt
         ::= 'EXPLAIN' opt_query_plan explain_target

referenced by:


opt_query_plan:

QUERY PLAN

opt_query_plan
         ::= 'QUERY PLAN'?

referenced by:


explain_target:

select_stmt update_stmt delete_stmt with_delete_stmt with_insert_stmt with_update_stmt with_upsert_stmt insert_stmt upsert_stmt drop_table_stmt drop_view_stmt drop_index_stmt drop_trigger_stmt begin_trans_stmt commit_trans_stmt

explain_target
         ::= select_stmt
           | update_stmt
           | delete_stmt
           | with_delete_stmt
           | with_insert_stmt
           | with_update_stmt
           | with_upsert_stmt
           | insert_stmt
           | upsert_stmt
           | drop_table_stmt
           | drop_view_stmt
           | drop_index_stmt
           | drop_trigger_stmt
           | begin_trans_stmt
           | commit_trans_stmt

referenced by:


schema_upgrade_version_stmt:

@SCHEMA_UPGRADE_VERSION ( integer-literal )

schema_upgrade_version_stmt
         ::= '@SCHEMA_UPGRADE_VERSION' '(' 'integer-literal' ')'

referenced by:


set_stmt:

SET sql_name [ arg_list ] := expr FROM CURSOR name

set_stmt ::= 'SET' sql_name ( ( '[' arg_list ']' )? ':=' expr | 'FROM' 'CURSOR' name )

referenced by:


let_stmt:

LET sql_name := expr

let_stmt ::= 'LET' sql_name ':=' expr

referenced by:


const_stmt:

CONST sql_name := expr

const_stmt
         ::= 'CONST' sql_name ':=' expr

referenced by:


version_attrs_opt_recreate:

@RECREATE ( name ) opt_delete_plain_attr version_attrs

version_attrs_opt_recreate
         ::= ( '@RECREATE' ( '(' name ')' )? opt_delete_plain_attr | version_attrs )?

referenced by:


opt_delete_plain_attr:

@DELETE

opt_delete_plain_attr
         ::= '@DELETE'?

referenced by:


opt_version_attrs:

version_attrs

opt_version_attrs
         ::= version_attrs?

referenced by:


version_attrs:

@CREATE @DELETE version_annotation opt_version_attrs

version_attrs
         ::= ( '@CREATE' | '@DELETE' ) version_annotation opt_version_attrs

referenced by:


opt_delete_version_attr:

@DELETE version_annotation

opt_delete_version_attr
         ::= ( '@DELETE' version_annotation )?

referenced by:


drop_table_stmt:

DROP TABLE IF EXISTS sql_name

drop_table_stmt
         ::= 'DROP' 'TABLE' ( 'IF' 'EXISTS' )? sql_name

referenced by:


drop_view_stmt:

DROP VIEW IF EXISTS sql_name

drop_view_stmt
         ::= 'DROP' 'VIEW' ( 'IF' 'EXISTS' )? sql_name

referenced by:


drop_index_stmt:

DROP INDEX IF EXISTS sql_name

drop_index_stmt
         ::= 'DROP' 'INDEX' ( 'IF' 'EXISTS' )? sql_name

referenced by:


drop_trigger_stmt:

DROP TRIGGER IF EXISTS sql_name

drop_trigger_stmt
         ::= 'DROP' 'TRIGGER' ( 'IF' 'EXISTS' )? sql_name

referenced by:


create_virtual_table_stmt:

CREATE VIRTUAL TABLE opt_vtab_flags sql_name USING name opt_module_args AS ( col_key_list ) opt_delete_version_attr

create_virtual_table_stmt
         ::= 'CREATE' 'VIRTUAL' 'TABLE' opt_vtab_flags sql_name 'USING' name opt_module_args 'AS' '(' col_key_list ')' opt_delete_version_attr

referenced by:


opt_module_args:

( misc_attr_value_list ARGUMENTS FOLLOWING )

opt_module_args
         ::= ( '(' ( misc_attr_value_list | 'ARGUMENTS' 'FOLLOWING' ) ')' )?

referenced by:


create_table_prefix_opt_temp:

CREATE opt_temp TABLE

create_table_prefix_opt_temp
         ::= 'CREATE' opt_temp 'TABLE'

referenced by:


create_table_stmt:

create_table_prefix_opt_temp opt_if_not_exists sql_name ( col_key_list ) opt_no_rowid version_attrs_opt_recreate

create_table_stmt
         ::= create_table_prefix_opt_temp opt_if_not_exists sql_name '(' col_key_list ')' opt_no_rowid version_attrs_opt_recreate

referenced by:


opt_temp:

TEMP

opt_temp ::= 'TEMP'?

referenced by:


opt_if_not_exists:

IF NOT EXISTS

opt_if_not_exists
         ::= ( 'IF' 'NOT' 'EXISTS' )?

referenced by:


opt_no_rowid:

WITHOUT ROWID

opt_no_rowid
         ::= ( 'WITHOUT' 'ROWID' )?

referenced by:


opt_vtab_flags:

IF NOT EXISTS @EPONYMOUS @EPONYMOUS IF NOT EXISTS

opt_vtab_flags
         ::= ( 'IF' 'NOT' 'EXISTS' '@EPONYMOUS'? | '@EPONYMOUS' ( 'IF' 'NOT' 'EXISTS' )? )?

referenced by:


col_key_list:

col_key_def ,

col_key_list
         ::= col_key_def ( ',' col_key_def )*

referenced by:


col_key_def:

col_def pk_def fk_def unq_def check_def shape_def

col_key_def
         ::= col_def
           | pk_def
           | fk_def
           | unq_def
           | check_def
           | shape_def

referenced by:


check_def:

CONSTRAINT name CHECK ( expr )

check_def
         ::= ( 'CONSTRAINT' name )? 'CHECK' '(' expr ')'

referenced by:


shape_expr:

- sql_name

shape_expr
         ::= '-'? sql_name

referenced by:


shape_def:

shape_def_base ( shape_expr , )

shape_def
         ::= shape_def_base ( '(' shape_expr ( ',' shape_expr )* ')' )?

referenced by:


shape_def_base:

LIKE sql_name name ARGUMENTS

shape_def_base
         ::= 'LIKE' ( sql_name | name 'ARGUMENTS' )

referenced by:


sql_name:

name `quoted identifier`

sql_name ::= name
           | '`quoted identifier`'

referenced by:


misc_attr_key:

name : name

misc_attr_key
         ::= name ( ':' name )?

referenced by:


cql_attr_key:

name : name

cql_attr_key
         ::= name ( ':' name )?

referenced by:


misc_attr_value_list:

misc_attr_value ,

misc_attr_value_list
         ::= misc_attr_value ( ',' misc_attr_value )*

referenced by:


misc_attr_value:

sql_name any_literal const_expr ( misc_attr_value_list ) - + num_literal

misc_attr_value
         ::= sql_name
           | any_literal
           | const_expr
           | '(' misc_attr_value_list ')'
           | ( '-' | '+' ) num_literal

referenced by:


misc_attr:

@ATTRIBUTE ( misc_attr_key = misc_attr_value ) [ [ cql_attr_key = misc_attr_value ] ]

misc_attr
         ::= '@ATTRIBUTE' '(' misc_attr_key ( '=' misc_attr_value )? ')'
           | '[' '[' cql_attr_key ( '=' misc_attr_value )? ']' ']'

referenced by:


misc_attrs:

misc_attr

misc_attrs
         ::= misc_attr*

referenced by:


col_def:

misc_attrs sql_name data_type_any not_null UNIQUE opt_conflict_clause PRIMARY KEY opt_conflict_clause AUTOINCREMENT DEFAULT - + num_literal const_expr str_literal COLLATE name CHECK ( expr ) HIDDEN @SENSITIVE @CREATE @DELETE version_annotation fk_target_options

col_def  ::= misc_attrs sql_name data_type_any ( ( not_null | 'UNIQUE' ) opt_conflict_clause | 'PRIMARY' 'KEY' opt_conflict_clause 'AUTOINCREMENT'? | 'DEFAULT' ( ( '-' | '+' )? num_literal | const_expr | str_literal ) | 'COLLATE' name | 'CHECK' '(' expr ')' | 'HIDDEN' | '@SENSITIVE' | ( '@CREATE' | '@DELETE' ) version_annotation | fk_target_options )*

referenced by:


pk_def:

CONSTRAINT sql_name PRIMARY KEY ( indexed_columns ) opt_conflict_clause

pk_def   ::= ( 'CONSTRAINT' sql_name )? 'PRIMARY' 'KEY' '(' indexed_columns ')' opt_conflict_clause

referenced by:


opt_conflict_clause:

conflict_clause

opt_conflict_clause
         ::= conflict_clause?

referenced by:


conflict_clause:

ON CONFLICT ROLLBACK ABORT FAIL IGNORE REPLACE

conflict_clause
         ::= 'ON CONFLICT' ( 'ROLLBACK' | 'ABORT' | 'FAIL' | 'IGNORE' | 'REPLACE' )

referenced by:


opt_fk_options:

fk_options

opt_fk_options
         ::= fk_options?

referenced by:


fk_options:

fk_on_options fk_deferred_options fk_deferred_options

fk_options
         ::= fk_on_options fk_deferred_options?
           | fk_deferred_options

referenced by:


fk_on_options:

ON DELETE fk_action ON UPDATE UPDATE fk_action ON DELETE fk_action

fk_on_options
         ::= 'ON' ( 'DELETE' ( fk_action 'ON' 'UPDATE' )? | 'UPDATE' ( fk_action 'ON' 'DELETE' )? ) fk_action

referenced by:


fk_action:

SET NULL DEFAULT CASCADE RESTRICT NO ACTION

fk_action
         ::= 'SET' ( 'NULL' | 'DEFAULT' )
           | 'CASCADE'
           | 'RESTRICT'
           | 'NO' 'ACTION'

referenced by:


fk_deferred_options:

DEFERRABLE NOT DEFERRABLE fk_initial_state

fk_deferred_options
         ::= ( 'DEFERRABLE' | 'NOT DEFERRABLE' ) fk_initial_state

referenced by:


fk_initial_state:

INITIALLY DEFERRED IMMEDIATE

fk_initial_state
         ::= ( 'INITIALLY' ( 'DEFERRED' | 'IMMEDIATE' ) )?

referenced by:


fk_def:

CONSTRAINT sql_name FOREIGN KEY ( sql_name_list ) fk_target_options

fk_def   ::= ( 'CONSTRAINT' sql_name )? 'FOREIGN' 'KEY' '(' sql_name_list ')' fk_target_options

referenced by:


fk_target_options:

REFERENCES sql_name ( sql_name_list ) opt_fk_options

fk_target_options
         ::= 'REFERENCES' sql_name '(' sql_name_list ')' opt_fk_options

referenced by:


unq_def:

CONSTRAINT sql_name UNIQUE ( indexed_columns ) opt_conflict_clause

unq_def  ::= ( 'CONSTRAINT' sql_name )? 'UNIQUE' '(' indexed_columns ')' opt_conflict_clause

referenced by:


opt_unique:

UNIQUE

opt_unique
         ::= 'UNIQUE'?

referenced by:


indexed_column:

expr opt_asc_desc

indexed_column
         ::= expr opt_asc_desc

referenced by:


indexed_columns:

indexed_column ,

indexed_columns
         ::= indexed_column ( ',' indexed_column )*

referenced by:


create_index_stmt:

CREATE opt_unique INDEX opt_if_not_exists sql_name ON sql_name ( indexed_columns ) opt_where opt_delete_version_attr

create_index_stmt
         ::= 'CREATE' opt_unique 'INDEX' opt_if_not_exists sql_name 'ON' sql_name '(' indexed_columns ')' opt_where opt_delete_version_attr

referenced by:


name:

ID TEXT TRIGGER ROWID REPLACE KEY VIRTUAL TYPE HIDDEN PRIVATE FIRST LAST ADD AFTER BEFORE VIEW INDEX COLUMN EXPR STMT_LIST QUERY_PARTS CTE_TABLES SELECT_CORE SELECT_EXPR @ID ( text_args )

name     ::= 'ID'
           | 'TEXT'
           | 'TRIGGER'
           | 'ROWID'
           | 'REPLACE'
           | 'KEY'
           | 'VIRTUAL'
           | 'TYPE'
           | 'HIDDEN'
           | 'PRIVATE'
           | 'FIRST'
           | 'LAST'
           | 'ADD'
           | 'AFTER'
           | 'BEFORE'
           | 'VIEW'
           | 'INDEX'
           | 'COLUMN'
           | 'EXPR'
           | 'STMT_LIST'
           | 'QUERY_PARTS'
           | 'CTE_TABLES'
           | 'SELECT_CORE'
           | 'SELECT_EXPR'
           | '@ID' '(' text_args ')'

referenced by:


loose_name:

name CALL SET BOOL INT LONG REAL BLOB OBJECT RIGHT LEFT

loose_name
         ::= name
           | 'CALL'
           | 'SET'
           | 'BOOL'
           | 'INT'
           | 'LONG'
           | 'REAL'
           | 'BLOB'
           | 'OBJECT'
           | 'RIGHT'
           | 'LEFT'

referenced by:


loose_name_or_type:

loose_name < loose_name > ALL

loose_name_or_type
         ::= loose_name ( '<' loose_name '>' )?
           | 'ALL'

referenced by:


opt_sql_name:

sql_name

opt_sql_name
         ::= sql_name?

referenced by:


name_list:

name ,

name_list
         ::= name ( ',' name )*

referenced by:


sql_name_list:

sql_name ,

sql_name_list
         ::= sql_name ( ',' sql_name )*

referenced by:


opt_name_list:

name_list

opt_name_list
         ::= name_list?

referenced by:


opt_sql_name_list:

sql_name_list

opt_sql_name_list
         ::= sql_name_list?

referenced by:


cte_binding_list:

cte_binding ,

cte_binding_list
         ::= cte_binding ( ',' cte_binding )*

referenced by:


cte_binding:

name AS name

cte_binding
         ::= name 'AS'? name

referenced by:


version_annotation:

( integer-literal , name : name )

version_annotation
         ::= '(' 'integer-literal' ( ',' name ( ':' name )? )? ')'

referenced by:


opt_kind:

< name >

opt_kind ::= ( '<' name '>' )?

referenced by:


data_type_numeric:

INT INTEGER REAL BOOL LONG_INT LONG_INTEGER LONG INTEGER INT opt_kind

data_type_numeric
         ::= ( 'INT' | 'INTEGER' | 'REAL' | 'BOOL' | 'LONG_INT' | 'LONG_INTEGER' | 'LONG' ( 'INTEGER' | 'INT' )? ) opt_kind

referenced by:


data_type_any:

data_type_numeric TEXT BLOB opt_kind OBJECT opt_kind < name CURSOR SET > ID @ID ( text_args )

data_type_any
         ::= data_type_numeric
           | ( 'TEXT' | 'BLOB' ) opt_kind
           | 'OBJECT' ( opt_kind | '<' name ( 'CURSOR' | 'SET' ) '>' )
           | 'ID'
           | '@ID' '(' text_args ')'

referenced by:


not_null:

NOT NULL !

not_null ::= 'NOT' 'NULL'
           | '!'

referenced by:


data_type_with_options:

data_type_any not_null @SENSITIVE @SENSITIVE not_null

data_type_with_options
         ::= data_type_any ( not_null '@SENSITIVE'? | '@SENSITIVE' not_null? )?

referenced by:


str_literal:

str_leaf

str_literal
         ::= str_leaf+

referenced by:


str_leaf:

sql-string-literal c-string-literal

str_leaf ::= 'sql-string-literal'
           | 'c-string-literal'

referenced by:


num_literal:

integer-literal long-literal real-literal TRUE FALSE

num_literal
         ::= 'integer-literal'
           | 'long-literal'
           | 'real-literal'
           | 'TRUE'
           | 'FALSE'

referenced by:


const_expr:

CONST ( expr )

const_expr
         ::= 'CONST' '(' expr ')'

referenced by:


any_literal:

str_literal num_literal NULL @FILE ( str_literal @TEXT ( text_args ) @LINE @MACRO_LINE @MACRO_FILE @PROC sql-blob-literal

any_literal
         ::= str_literal
           | num_literal
           | 'NULL'
           | ( '@FILE' '(' str_literal | '@TEXT' '(' text_args ) ')'
           | '@LINE'
           | '@MACRO_LINE'
           | '@MACRO_FILE'
           | '@PROC'
           | 'sql-blob-literal'

referenced by:


text_args:

text_arg ,

text_args
         ::= text_arg ( ',' text_arg )*

referenced by:


text_arg:

expr non_expr_macro_ref

text_arg ::= expr
           | non_expr_macro_ref

referenced by:


raise_expr:

RAISE ( IGNORE ROLLBACK ABORT FAIL , expr )

raise_expr
         ::= 'RAISE' '(' ( 'IGNORE' | ( 'ROLLBACK' | 'ABORT' | 'FAIL' ) ',' expr ) ')'

referenced by:


opt_distinct:

DISTINCT

opt_distinct
         ::= 'DISTINCT'?

referenced by:


simple_call:

loose_name GLOB LIKE ( opt_distinct arg_list ) opt_filter_clause

simple_call
         ::= ( loose_name | 'GLOB' | 'LIKE' ) '(' opt_distinct arg_list ')' opt_filter_clause

referenced by:


call:

simple_call basic_expr : simple_call loose_name ( arg_list )

call     ::= simple_call
           | basic_expr ':' ( simple_call | loose_name | '(' arg_list ')' )

referenced by:


basic_expr:

name `quoted identifier` expr_macro_ref * @RC basic_expr . sql_name * [ arg_list ] ~ data_type_any ~ -> ->> ~ data_type_any ~ basic_expr any_literal const_expr ( expr select_stmt IF NOTHING OR NULL THEN expr THROW THEN expr THROW EXISTS ( select_stmt CAST ( expr AS data_type_any TYPE_CHECK ( expr AS data_type_with_options ) call window_func_inv raise_expr CASE expr WHEN expr THEN expr ELSE expr END

basic_expr
         ::= name
           | '`quoted identifier`'
           | expr_macro_ref
           | '*'
           | '@RC'
           | basic_expr ( '.' ( sql_name | '*' ) | '[' arg_list ']' | '~' data_type_any '~' | ( '->' | '->>' '~' data_type_any '~' ) basic_expr )
           | any_literal
           | const_expr
           | ( '(' ( expr | select_stmt ( 'IF' 'NOTHING' ( ( 'OR' 'NULL' 'THEN'? )? expr | 'THROW' | 'THEN' ( expr | 'THROW' ) ) )? ) | 'EXISTS' '(' select_stmt | 'CAST' '(' expr 'AS' data_type_any | 'TYPE_CHECK' '(' expr 'AS' data_type_with_options ) ')'
           | call
           | window_func_inv
           | raise_expr
           | 'CASE' expr? ( 'WHEN' expr 'THEN' expr )+ ( 'ELSE' expr )? 'END'

referenced by:


math_expr:

basic_expr math_expr & | << >> + - * / % = == < > <> != >= <= LIKE NOT LIKE MATCH NOT MATCH REGEXP NOT REGEXP GLOB NOT GLOB BETWEEN NOT BETWEEN math_expr AND IS NOT IS || math_expr IS NOT TRUE IS NOT FALSE ISNULL NOTNULL IS TRUE IS FALSE NOT IN IN ( opt_expr_list select_stmt ) COLLATE name - + ~ NOT math_expr

math_expr
         ::= basic_expr
           | math_expr ( ( '&' | '|' | '<<' | '>>' | '+' | '-' | '*' | '/' | '%' | '=' | '==' | '<' | '>' | '<>' | '!=' | '>=' | '<=' | 'LIKE' | 'NOT LIKE' | 'MATCH' | 'NOT MATCH' | 'REGEXP' | 'NOT REGEXP' | 'GLOB' | 'NOT GLOB' | ( 'BETWEEN' | 'NOT BETWEEN' ) math_expr 'AND' | 'IS NOT' | 'IS' | '||' ) math_expr | 'IS NOT TRUE' | 'IS NOT FALSE' | 'ISNULL' | 'NOTNULL' | 'IS TRUE' | 'IS FALSE' | ( 'NOT IN' | 'IN' ) '(' ( opt_expr_list | select_stmt ) ')' | 'COLLATE' name )
           | ( '-' | '+' | '~' | 'NOT' ) math_expr

referenced by:


expr:

math_expr expr AND OR := += -= /= *= %= &= |= <<= >>= expr

expr     ::= math_expr
           | expr ( 'AND' | 'OR' | ':=' | '+=' | '-=' | '/=' | '*=' | '%=' | '&=' | '|=' | '<<=' | '>>=' ) expr

referenced by:


arg_expr:

expr shape_arguments

arg_expr ::= expr
           | shape_arguments

referenced by:


arg_list:

arg_expr ,

arg_list ::= ( arg_expr ( ',' arg_expr )* )?

referenced by:


opt_expr_list:

expr_list

opt_expr_list
         ::= expr_list?

referenced by:


expr_list:

expr ,

expr_list
         ::= expr ( ',' expr )*

referenced by:


shape_arguments:

FROM name ARGUMENTS shape_def

shape_arguments
         ::= 'FROM' ( name | 'ARGUMENTS' ) shape_def?

referenced by:


column_calculation:

@COLUMNS ( DISTINCT col_calc , )

column_calculation
         ::= '@COLUMNS' '(' 'DISTINCT'? col_calc ( ',' col_calc )* ')'

referenced by:


col_calc:

name shape_def . name shape_def

col_calc ::= name ( shape_def | '.' name )?
           | shape_def

referenced by:


cte_tables:

cte_table ,

cte_tables
         ::= cte_table ( ',' cte_table )*

referenced by:


cte_decl:

name ( name_list * )

cte_decl ::= name ( '(' ( name_list | '*' ) ')' )?

referenced by:


shared_cte:

call_stmt USING cte_binding_list

shared_cte
         ::= call_stmt ( 'USING' cte_binding_list )?

referenced by:


cte_table:

cte_decl AS ( select_stmt shared_cte ) LIKE ( select_stmt ) sql_name ( call_stmt USING cte_binding_list ) cte_tables_macro_ref

cte_table
         ::= cte_decl ( 'AS' '(' ( select_stmt | shared_cte ) ')' | 'LIKE' ( '(' select_stmt ')' | sql_name ) )
           | '(' call_stmt ( 'USING' cte_binding_list )? ')'
           | cte_tables_macro_ref

referenced by:


with_prefix:

WITH RECURSIVE cte_tables

with_prefix
         ::= 'WITH' 'RECURSIVE'? cte_tables

referenced by:


with_select_stmt:

with_prefix select_stmt_no_with

with_select_stmt
         ::= with_prefix select_stmt_no_with

referenced by:


select_nothing_stmt:

SELECT NOTHING

select_nothing_stmt
         ::= 'SELECT' 'NOTHING'

referenced by:


select_stmt:

with_select_stmt select_stmt_no_with

select_stmt
         ::= with_select_stmt
           | select_stmt_no_with

referenced by:


select_stmt_no_with:

select_core_list opt_orderby opt_limit opt_offset

select_stmt_no_with
         ::= select_core_list opt_orderby opt_limit opt_offset

referenced by:


select_core_list:

select_core select_core_macro_ref compound_operator

select_core_list
         ::= ( select_core | select_core_macro_ref ) ( compound_operator ( select_core | select_core_macro_ref ) )*

referenced by:


select_core:

SELECT select_opts select_expr_list opt_from_query_parts opt_where opt_groupby opt_having opt_select_window VALUES ( insert_list ) ,

select_core
         ::= 'SELECT' select_opts select_expr_list opt_from_query_parts opt_where opt_groupby opt_having opt_select_window
           | 'VALUES' '(' insert_list ')' ( ',' '(' insert_list ')' )*

referenced by:


compound_operator:

UNION UNION ALL INTERSECT EXCEPT

compound_operator
         ::= 'UNION'
           | 'UNION ALL'
           | 'INTERSECT'
           | 'EXCEPT'

referenced by:


window_func_inv:

simple_call OVER window_name_or_defn

window_func_inv
         ::= simple_call 'OVER' window_name_or_defn

referenced by:


opt_filter_clause:

FILTER ( opt_where )

opt_filter_clause
         ::= ( 'FILTER' '(' opt_where ')' )?

referenced by:


window_name_or_defn:

window_defn name

window_name_or_defn
         ::= window_defn
           | name

referenced by:


window_defn:

( opt_partition_by opt_orderby opt_frame_spec )

window_defn
         ::= '(' opt_partition_by opt_orderby opt_frame_spec ')'

referenced by:


opt_frame_spec:

frame_type frame_boundary_opts frame_exclude

opt_frame_spec
         ::= ( frame_type frame_boundary_opts frame_exclude )?

referenced by:


frame_type:

RANGE ROWS GROUPS

frame_type
         ::= 'RANGE'
           | 'ROWS'
           | 'GROUPS'

referenced by:


frame_exclude:

EXCLUDE NO OTHERS EXCLUDE CURRENT ROW EXCLUDE GROUP EXCLUDE TIES

frame_exclude
         ::= ( 'EXCLUDE NO OTHERS' | 'EXCLUDE CURRENT ROW' | 'EXCLUDE GROUP' | 'EXCLUDE TIES' )?

referenced by:


frame_boundary_opts:

frame_boundary BETWEEN frame_boundary_start AND frame_boundary_end

frame_boundary_opts
         ::= frame_boundary
           | 'BETWEEN' frame_boundary_start 'AND' frame_boundary_end

referenced by:


frame_boundary_start:

UNBOUNDED PRECEDING expr PRECEDING FOLLOWING CURRENT ROW

frame_boundary_start
         ::= 'UNBOUNDED' 'PRECEDING'
           | expr ( 'PRECEDING' | 'FOLLOWING' )
           | 'CURRENT ROW'

referenced by:


frame_boundary_end:

expr PRECEDING FOLLOWING CURRENT ROW UNBOUNDED FOLLOWING

frame_boundary_end
         ::= expr ( 'PRECEDING' | 'FOLLOWING' )
           | 'CURRENT ROW'
           | 'UNBOUNDED' 'FOLLOWING'

referenced by:


frame_boundary:

UNBOUNDED expr PRECEDING CURRENT ROW

frame_boundary
         ::= ( 'UNBOUNDED' | expr ) 'PRECEDING'
           | 'CURRENT ROW'

referenced by:


opt_partition_by:

PARTITION BY expr_list

opt_partition_by
         ::= ( 'PARTITION' 'BY' expr_list )?

referenced by:


opt_select_window:

window_clause

opt_select_window
         ::= window_clause?

referenced by:


window_clause:

WINDOW window_name_defn ,

window_clause
         ::= 'WINDOW' window_name_defn ( ',' window_name_defn )*

referenced by:


window_name_defn:

name AS window_defn

window_name_defn
         ::= name 'AS' window_defn

referenced by:


region_spec:

name PRIVATE

region_spec
         ::= name 'PRIVATE'?

referenced by:


region_list:

region_spec ,

region_list
         ::= region_spec ( ',' region_spec )*

referenced by:


declare_schema_region_stmt:

@DECLARE_SCHEMA_REGION name USING region_list

declare_schema_region_stmt
         ::= '@DECLARE_SCHEMA_REGION' name ( 'USING' region_list )?

referenced by:


declare_deployable_region_stmt:

@DECLARE_DEPLOYABLE_REGION name USING region_list

declare_deployable_region_stmt
         ::= '@DECLARE_DEPLOYABLE_REGION' name ( 'USING' region_list )?

referenced by:


begin_schema_region_stmt:

@BEGIN_SCHEMA_REGION name

begin_schema_region_stmt
         ::= '@BEGIN_SCHEMA_REGION' name

referenced by:


schema_unsub_stmt:

@UNSUB ( sql_name )

schema_unsub_stmt
         ::= '@UNSUB' '(' sql_name ')'

referenced by:


schema_ad_hoc_migration_stmt:

@SCHEMA_AD_HOC_MIGRATION version_annotation FOR @RECREATE ( name , name )

schema_ad_hoc_migration_stmt
         ::= '@SCHEMA_AD_HOC_MIGRATION' ( version_annotation | 'FOR' '@RECREATE' '(' name ',' name ')' )

referenced by:


emit_enums_stmt:

@EMIT_ENUMS opt_name_list

emit_enums_stmt
         ::= '@EMIT_ENUMS' opt_name_list

referenced by:


emit_group_stmt:

@EMIT_GROUP opt_name_list

emit_group_stmt
         ::= '@EMIT_GROUP' opt_name_list

referenced by:


emit_constants_stmt:

@EMIT_CONSTANTS name_list

emit_constants_stmt
         ::= '@EMIT_CONSTANTS' name_list

referenced by:


opt_from_query_parts:

FROM query_parts

opt_from_query_parts
         ::= ( 'FROM' query_parts )?

referenced by:


opt_where:

WHERE expr

opt_where
         ::= ( 'WHERE' expr )?

referenced by:


opt_groupby:

GROUP BY groupby_item ,

opt_groupby
         ::= ( 'GROUP' 'BY' groupby_item ( ',' groupby_item )* )?

referenced by:


groupby_item:

expr

groupby_item
         ::= expr

referenced by:


opt_asc_desc:

ASC DESC opt_nullsfirst_nullslast

opt_asc_desc
         ::= ( ( 'ASC' | 'DESC' ) opt_nullsfirst_nullslast )?

referenced by:


opt_nullsfirst_nullslast:

NULLS FIRST LAST

opt_nullsfirst_nullslast
         ::= ( 'NULLS' ( 'FIRST' | 'LAST' ) )?

referenced by:


opt_having:

HAVING expr

opt_having
         ::= ( 'HAVING' expr )?

referenced by:


opt_orderby:

ORDER BY orderby_item ,

opt_orderby
         ::= ( 'ORDER' 'BY' orderby_item ( ',' orderby_item )* )?

referenced by:


orderby_item:

expr opt_asc_desc

orderby_item
         ::= expr opt_asc_desc

referenced by:


opt_limit:

LIMIT expr

opt_limit
         ::= ( 'LIMIT' expr )?

referenced by:


opt_offset:

OFFSET expr

opt_offset
         ::= ( 'OFFSET' expr )?

referenced by:


select_opts:

ALL DISTINCT DISTINCTROW

select_opts
         ::= ( 'ALL' | 'DISTINCT' | 'DISTINCTROW' )?

referenced by:


select_expr_list:

select_expr select_expr_macro_ref ,

select_expr_list
         ::= ( select_expr | select_expr_macro_ref ) ( ',' ( select_expr | select_expr_macro_ref ) )*

referenced by:


select_expr:

expr opt_as_alias column_calculation

select_expr
         ::= expr opt_as_alias
           | column_calculation

referenced by:


opt_as_alias:

as_alias

opt_as_alias
         ::= as_alias?

referenced by:


as_alias:

AS sql_name

as_alias ::= 'AS'? sql_name

referenced by:


query_parts:

table_or_subquery , join_clause

query_parts
         ::= table_or_subquery ( ',' table_or_subquery )*
           | join_clause

referenced by:


join_clause:

table_or_subquery join_target

join_clause
         ::= table_or_subquery join_target+

referenced by:


table_or_subquery:

sql_name table_function query_parts_macro_ref opt_as_alias ( select_stmt shared_cte ) opt_as_alias query_parts )

table_or_subquery
         ::= ( sql_name | table_function | query_parts_macro_ref ) opt_as_alias
           | '(' ( ( select_stmt | shared_cte ) ')' opt_as_alias | query_parts ')' )

referenced by:


join_type:

LEFT RIGHT OUTER INNER CROSS

join_type
         ::= ( ( 'LEFT' | 'RIGHT' ) 'OUTER'? | 'INNER' | 'CROSS' )?

referenced by:


join_target:

join_type JOIN table_or_subquery opt_join_cond

join_target
         ::= join_type 'JOIN' table_or_subquery opt_join_cond

referenced by:


opt_join_cond:

join_cond

opt_join_cond
         ::= join_cond?

referenced by:


join_cond:

ON expr USING ( name_list )

join_cond
         ::= 'ON' expr
           | 'USING' '(' name_list ')'

referenced by:


table_function:

name ( arg_list )

table_function
         ::= name '(' arg_list ')'

referenced by:


create_view_stmt:

CREATE opt_temp VIEW opt_if_not_exists sql_name ( name_list ) AS select_stmt opt_delete_version_attr

create_view_stmt
         ::= 'CREATE' opt_temp 'VIEW' opt_if_not_exists sql_name ( '(' name_list ')' )? 'AS' select_stmt opt_delete_version_attr

referenced by:


with_delete_stmt:

with_prefix delete_stmt

with_delete_stmt
         ::= with_prefix delete_stmt

referenced by:


delete_stmt:

DELETE FROM sql_name opt_where

delete_stmt
         ::= 'DELETE' 'FROM' sql_name opt_where

referenced by:


opt_insert_dummy_spec:

@DUMMY_SEED ( expr ) dummy_modifier

opt_insert_dummy_spec
         ::= ( '@DUMMY_SEED' '(' expr ')' dummy_modifier )?

referenced by:


dummy_modifier:

@DUMMY_NULLABLES @DUMMY_DEFAULTS @DUMMY_DEFAULTS @DUMMY_NULLABLES

dummy_modifier
         ::= ( '@DUMMY_NULLABLES' '@DUMMY_DEFAULTS'? | '@DUMMY_DEFAULTS' '@DUMMY_NULLABLES'? )?

referenced by:


insert_stmt_type:

INSERT OR REPLACE IGNORE ROLLBACK ABORT FAIL REPLACE INTO

insert_stmt_type
         ::= ( 'INSERT' ( 'OR' ( 'REPLACE' | 'IGNORE' | 'ROLLBACK' | 'ABORT' | 'FAIL' ) )? | 'REPLACE' ) 'INTO'

referenced by:


with_insert_stmt:

with_prefix insert_stmt

with_insert_stmt
         ::= with_prefix insert_stmt

referenced by:


opt_column_spec:

( opt_sql_name_list shape_def )

opt_column_spec
         ::= ( '(' ( opt_sql_name_list | shape_def ) ')' )?

referenced by:


column_spec:

( sql_name_list shape_def )

column_spec
         ::= '(' ( sql_name_list | shape_def ) ')'

referenced by:


from_shape:

FROM CURSOR name ARGUMENTS opt_column_spec

from_shape
         ::= 'FROM' ( 'CURSOR'? name | 'ARGUMENTS' ) opt_column_spec

referenced by:


insert_stmt:

insert_stmt_type sql_name opt_column_spec select_stmt from_shape opt_insert_dummy_spec DEFAULT VALUES USING select_stmt expr_names opt_insert_dummy_spec

insert_stmt
         ::= insert_stmt_type sql_name ( opt_column_spec ( select_stmt | from_shape ) opt_insert_dummy_spec | 'DEFAULT' 'VALUES' | 'USING' ( select_stmt | expr_names opt_insert_dummy_spec ) )

referenced by:


insert_list_item:

expr shape_arguments

insert_list_item
         ::= expr
           | shape_arguments

referenced by:


insert_list:

insert_list_item , insert_list_item

insert_list
         ::= ( insert_list_item ',' )* insert_list_item?

referenced by:


basic_update_stmt:

UPDATE opt_sql_name SET update_list opt_from_query_parts opt_where

basic_update_stmt
         ::= 'UPDATE' opt_sql_name 'SET' update_list opt_from_query_parts opt_where

referenced by:


with_update_stmt:

with_prefix update_stmt

with_update_stmt
         ::= with_prefix update_stmt

referenced by:


update_stmt:

UPDATE sql_name SET update_list column_spec = ( insert_list ) opt_from_query_parts opt_where opt_orderby opt_limit

update_stmt
         ::= 'UPDATE' sql_name 'SET' ( update_list | column_spec '=' '(' insert_list ')' ) opt_from_query_parts opt_where opt_orderby opt_limit

referenced by:


update_entry:

sql_name = expr

update_entry
         ::= sql_name '=' expr

referenced by:


update_list:

update_entry ,

update_list
         ::= update_entry ( ',' update_entry )*

referenced by:


with_upsert_stmt:

with_prefix upsert_stmt

with_upsert_stmt
         ::= with_prefix upsert_stmt

referenced by:


upsert_stmt:

insert_stmt ON CONFLICT conflict_target DO NOTHING basic_update_stmt

upsert_stmt
         ::= insert_stmt 'ON CONFLICT' conflict_target 'DO' ( 'NOTHING' | basic_update_stmt )

referenced by:


update_cursor_stmt:

UPDATE CURSOR name opt_column_spec FROM VALUES ( insert_list ) from_shape USING expr_names

update_cursor_stmt
         ::= 'UPDATE' 'CURSOR' name ( opt_column_spec ( 'FROM' 'VALUES' '(' insert_list ')' | from_shape ) | 'USING' expr_names )

referenced by:


conflict_target:

( indexed_columns ) opt_where

conflict_target
         ::= ( '(' indexed_columns ')' opt_where )?

referenced by:


function:

FUNC FUNCTION

function ::= 'FUNC'
           | 'FUNCTION'

referenced by:


declare_out_call_stmt:

DECLARE OUT call_stmt

declare_out_call_stmt
         ::= 'DECLARE' 'OUT' call_stmt

referenced by:


declare_enum_stmt:

DECLARE ENUM name data_type_numeric ( enum_value , )

declare_enum_stmt
         ::= 'DECLARE' 'ENUM' name data_type_numeric '(' enum_value ( ',' enum_value )* ')'

referenced by:


enum_value:

name = expr

enum_value
         ::= name ( '=' expr )?

referenced by:


declare_const_stmt:

DECLARE CONST GROUP name ( const_value , )

declare_const_stmt
         ::= 'DECLARE' 'CONST' 'GROUP' name '(' const_value ( ',' const_value )* ')'

referenced by:


declare_group_stmt:

DECLARE GROUP name BEGIN declare_vars_stmt ; END

declare_group_stmt
         ::= 'DECLARE' 'GROUP' name 'BEGIN' ( declare_vars_stmt ';' )+ 'END'

referenced by:


const_value:

name = expr

const_value
         ::= name '=' expr

referenced by:


declare_select_func_stmt:

DECLARE SELECT function name ( params ) NO CHECK data_type_with_options ( typed_names )

declare_select_func_stmt
         ::= 'DECLARE' 'SELECT' function name ( '(' params ')' | 'NO' 'CHECK' ) ( data_type_with_options | '(' typed_names ')' )

referenced by:


declare_func_stmt:

DECLARE function loose_name ( func_param , func_param ) NO CHECK CREATE data_type_with_options

declare_func_stmt
         ::= 'DECLARE' function loose_name ( '(' ( func_param ',' )* func_param? ')' | 'NO' 'CHECK' ) 'CREATE'? data_type_with_options

referenced by:


procedure:

PROC PROCEDURE

procedure
         ::= 'PROC'
           | 'PROCEDURE'

referenced by:


declare_proc_no_check_stmt:

DECLARE procedure loose_name NO CHECK

declare_proc_no_check_stmt
         ::= 'DECLARE' procedure loose_name 'NO' 'CHECK'

referenced by:


declare_proc_stmt:

DECLARE procedure loose_name ( params ) OUT UNION ( typed_names ) USING TRANSACTION ( typed_names )

declare_proc_stmt
         ::= 'DECLARE' procedure loose_name '(' params ')' ( ( 'OUT' 'UNION'? '(' typed_names ')' )? ( 'USING' 'TRANSACTION' )? | '(' typed_names ')' )

referenced by:


declare_interface_stmt:

DECLARE INTERFACE name ( typed_names )

declare_interface_stmt
         ::= 'DECLARE'? 'INTERFACE' name '(' typed_names ')'

referenced by:


create_proc_stmt:

CREATE procedure loose_name ( params ) BEGIN opt_stmt_list END

create_proc_stmt
         ::= 'CREATE'? procedure loose_name '(' params ')' 'BEGIN' opt_stmt_list 'END'

referenced by:


inout:

IN OUT INOUT

inout    ::= 'IN'
           | 'OUT'
           | 'INOUT'

referenced by:


typed_name:

sql_name data_type_with_options name shape_def

typed_name
         ::= sql_name data_type_with_options
           | name? shape_def

referenced by:


typed_names:

typed_name ,

typed_names
         ::= typed_name ( ',' typed_name )*

referenced by:


func_param:

param name CURSOR

func_param
         ::= param
           | name 'CURSOR'

referenced by:


param:

inout sql_name data_type_with_options name shape_def

param    ::= inout? sql_name data_type_with_options
           | name? shape_def

referenced by:


params:

param , param

params   ::= ( param ',' )* param?

referenced by:


declare_value_cursor:

DECLARE name CURSOR CURSOR name shape_def LIKE select_stmt ( typed_names )

declare_value_cursor
         ::= ( 'DECLARE' name 'CURSOR' | 'CURSOR' name ) ( shape_def | 'LIKE' ( select_stmt | '(' typed_names ')' ) )

referenced by:


declare_forward_read_cursor_stmt:

DECLARE name CURSOR CURSOR name FOR select_stmt explain_stmt call_stmt expr

declare_forward_read_cursor_stmt
         ::= ( 'DECLARE' name 'CURSOR' | 'CURSOR' name ) 'FOR' ( select_stmt | explain_stmt | call_stmt | expr )

referenced by:


declare_fetched_value_cursor_stmt:

DECLARE name CURSOR CURSOR name FETCH FROM call_stmt

declare_fetched_value_cursor_stmt
         ::= ( 'DECLARE' name 'CURSOR' | 'CURSOR' name ) 'FETCH' 'FROM' call_stmt

referenced by:


declare_type_stmt:

DECLARE name TYPE TYPE name data_type_with_options

declare_type_stmt
         ::= ( 'DECLARE' name 'TYPE' | 'TYPE' name ) data_type_with_options

referenced by:


declare_vars_stmt:

DECLARE sql_name_list VAR name_list data_type_with_options declare_value_cursor

declare_vars_stmt
         ::= ( 'DECLARE' sql_name_list | 'VAR' name_list ) data_type_with_options
           | declare_value_cursor

referenced by:


call_stmt:

CALL loose_name ( arg_list )

call_stmt
         ::= 'CALL' loose_name '(' arg_list ')'

referenced by:


while_stmt:

WHILE expr BEGIN opt_stmt_list END

while_stmt
         ::= 'WHILE' expr 'BEGIN' opt_stmt_list 'END'

referenced by:


switch_stmt:

SWITCH expr ALL VALUES switch_case ELSE stmt_list END

switch_stmt
         ::= 'SWITCH' expr ( 'ALL' 'VALUES' )? switch_case+ ( 'ELSE' stmt_list )? 'END'

referenced by:


switch_case:

WHEN expr_list THEN stmt_list NOTHING

switch_case
         ::= 'WHEN' expr_list 'THEN' ( stmt_list | 'NOTHING' )

referenced by:


loop_stmt:

LOOP fetch_stmt BEGIN opt_stmt_list END

loop_stmt
         ::= 'LOOP' fetch_stmt 'BEGIN' opt_stmt_list 'END'

referenced by:


rollback_return_stmt:

ROLLBACK RETURN

rollback_return_stmt
         ::= 'ROLLBACK' 'RETURN'

referenced by:


commit_return_stmt:

COMMIT RETURN

commit_return_stmt
         ::= 'COMMIT' 'RETURN'

referenced by:


trycatch_stmt:

BEGIN TRY opt_stmt_list END TRY ; BEGIN CATCH opt_stmt_list END CATCH TRY opt_stmt_list CATCH opt_stmt_list END

trycatch_stmt
         ::= 'BEGIN' 'TRY' opt_stmt_list 'END' 'TRY' ';' 'BEGIN' 'CATCH' opt_stmt_list 'END' 'CATCH'
           | 'TRY' opt_stmt_list 'CATCH' opt_stmt_list 'END'

referenced by:


fetch_stmt:

FETCH name INTO name_list

fetch_stmt
         ::= 'FETCH' name ( 'INTO' name_list )?

referenced by:


fetch_cursor_from_blob_stmt:

FETCH name FROM BLOB expr

fetch_cursor_from_blob_stmt
         ::= 'FETCH' name 'FROM BLOB' expr

referenced by:


fetch_values_stmt:

FETCH name opt_column_spec FROM VALUES ( insert_list ) from_shape USING expr_names opt_insert_dummy_spec

fetch_values_stmt
         ::= 'FETCH' name ( opt_column_spec ( 'FROM' 'VALUES' '(' insert_list ')' | from_shape ) | 'USING' expr_names ) opt_insert_dummy_spec

referenced by:


expr_names:

expr_name ,

expr_names
         ::= expr_name ( ',' expr_name )*

referenced by:


expr_name:

expr as_alias

expr_name
         ::= expr as_alias

referenced by:


fetch_call_stmt:

FETCH name opt_column_spec FROM call_stmt

fetch_call_stmt
         ::= 'FETCH' name opt_column_spec 'FROM' call_stmt

referenced by:


close_stmt:

CLOSE name

close_stmt
         ::= 'CLOSE' name

referenced by:


out_stmt:

OUT name

out_stmt ::= 'OUT' name

referenced by:


out_union_stmt:

OUT UNION name

out_union_stmt
         ::= 'OUT' 'UNION' name

referenced by:


out_union_parent_child_stmt:

OUT UNION call_stmt JOIN child_result AND

out_union_parent_child_stmt
         ::= 'OUT' 'UNION' call_stmt 'JOIN' child_result ( 'AND' child_result )*

referenced by:


child_result:

call_stmt USING ( name_list ) AS name

child_result
         ::= call_stmt 'USING' '(' name_list ')' ( 'AS' name )?

referenced by:


if_stmt:

IF expr THEN opt_stmt_list opt_elseif_list opt_else END IF

if_stmt  ::= 'IF' expr 'THEN' opt_stmt_list opt_elseif_list opt_else 'END' 'IF'?

referenced by:


opt_else:

ELSE opt_stmt_list

opt_else ::= ( 'ELSE' opt_stmt_list )?

referenced by:


elseif_item:

ELSE IF expr THEN opt_stmt_list

elseif_item
         ::= 'ELSE IF' expr 'THEN' opt_stmt_list

referenced by:


opt_elseif_list:

elseif_item

opt_elseif_list
         ::= elseif_item*

referenced by:


control_stmt:

commit_return_stmt CONTINUE LEAVE RETURN rollback_return_stmt THROW

control_stmt
         ::= commit_return_stmt
           | 'CONTINUE'
           | 'LEAVE'
           | 'RETURN'
           | rollback_return_stmt
           | 'THROW'

referenced by:


guard_stmt:

IF expr control_stmt

guard_stmt
         ::= 'IF' expr control_stmt

referenced by:


transaction_mode:

DEFERRED IMMEDIATE EXCLUSIVE

transaction_mode
         ::= ( 'DEFERRED' | 'IMMEDIATE' | 'EXCLUSIVE' )?

referenced by:


begin_trans_stmt:

BEGIN transaction_mode TRANSACTION

begin_trans_stmt
         ::= 'BEGIN' transaction_mode 'TRANSACTION'?

referenced by:


rollback_trans_stmt:

ROLLBACK TRANSACTION TO SAVEPOINT savepoint_name

rollback_trans_stmt
         ::= 'ROLLBACK' 'TRANSACTION'? ( 'TO' 'SAVEPOINT'? savepoint_name )?

referenced by:


commit_trans_stmt:

COMMIT TRANSACTION

commit_trans_stmt
         ::= 'COMMIT' 'TRANSACTION'?

referenced by:


proc_savepoint_stmt:

procedure SAVEPOINT BEGIN opt_stmt_list END

proc_savepoint_stmt
         ::= procedure 'SAVEPOINT' 'BEGIN' opt_stmt_list 'END'

referenced by:


savepoint_name:

@PROC name

savepoint_name
         ::= '@PROC'
           | name

referenced by:


savepoint_stmt:

SAVEPOINT savepoint_name

savepoint_stmt
         ::= 'SAVEPOINT' savepoint_name

referenced by:


release_savepoint_stmt:

RELEASE SAVEPOINT savepoint_name

release_savepoint_stmt
         ::= 'RELEASE' 'SAVEPOINT'? savepoint_name

referenced by:


echo_stmt:

@ECHO name , str_literal @TEXT ( text_args )

echo_stmt
         ::= '@ECHO' name ',' ( str_literal | '@TEXT' '(' text_args ')' )

referenced by:


alter_table_add_column_stmt:

ALTER TABLE sql_name ADD COLUMN col_def

alter_table_add_column_stmt
         ::= 'ALTER' 'TABLE' sql_name 'ADD' 'COLUMN' col_def

referenced by:


create_trigger_stmt:

CREATE opt_temp TRIGGER opt_if_not_exists trigger_def opt_delete_version_attr

create_trigger_stmt
         ::= 'CREATE' opt_temp 'TRIGGER' opt_if_not_exists trigger_def opt_delete_version_attr

referenced by:


trigger_def:

sql_name trigger_condition trigger_operation ON sql_name trigger_action

trigger_def
         ::= sql_name trigger_condition trigger_operation 'ON' sql_name trigger_action

referenced by:


trigger_condition:

BEFORE AFTER INSTEAD OF

trigger_condition
         ::= ( 'BEFORE' | 'AFTER' | 'INSTEAD' 'OF' )?

referenced by:


trigger_operation:

DELETE INSERT UPDATE opt_of

trigger_operation
         ::= 'DELETE'
           | 'INSERT'
           | 'UPDATE' opt_of

referenced by:


opt_of:

OF name_list

opt_of   ::= ( 'OF' name_list )?

referenced by:


trigger_action:

opt_foreachrow opt_when_expr BEGIN trigger_stmt END

trigger_action
         ::= opt_foreachrow opt_when_expr 'BEGIN' trigger_stmt+ 'END'

referenced by:


opt_foreachrow:

FOR EACH ROW

opt_foreachrow
         ::= 'FOR EACH ROW'?

referenced by:


opt_when_expr:

WHEN expr

opt_when_expr
         ::= ( 'WHEN' expr )?

referenced by:


trigger_stmt:

trigger_update_stmt trigger_insert_stmt trigger_delete_stmt trigger_select_stmt ;

trigger_stmt
         ::= ( trigger_update_stmt | trigger_insert_stmt | trigger_delete_stmt | trigger_select_stmt ) ';'

referenced by:


trigger_select_stmt:

select_stmt_no_with

trigger_select_stmt
         ::= select_stmt_no_with

referenced by:


trigger_insert_stmt:

insert_stmt

trigger_insert_stmt
         ::= insert_stmt

referenced by:


trigger_delete_stmt:

delete_stmt

trigger_delete_stmt
         ::= delete_stmt

referenced by:


trigger_update_stmt:

basic_update_stmt

trigger_update_stmt
         ::= basic_update_stmt

referenced by:


enforcement_options:

FOREIGN KEY ON UPDATE DELETE JOIN UPSERT STATEMENT WINDOW function WITHOUT ROWID TRANSACTION SELECT IF NOTHING INSERT SELECT TABLE FUNCTION ENCODE CONTEXT COLUMN CONTEXT TYPE INTEGER LONG_INTEGER REAL BOOL TEXT BLOB IS TRUE CAST SIGN FUNCTION CURSOR HAS ROW UPDATE FROM AND OR NOT NULL CHECK

enforcement_options
         ::= 'FOREIGN' 'KEY' 'ON' ( 'UPDATE' | 'DELETE' )
           | 'JOIN'
           | 'UPSERT' 'STATEMENT'
           | 'WINDOW' function
           | 'WITHOUT' 'ROWID'
           | 'TRANSACTION'
           | 'SELECT' 'IF' 'NOTHING'
           | 'INSERT' 'SELECT'
           | 'TABLE' 'FUNCTION'
           | 'ENCODE' ( 'CONTEXT COLUMN' | 'CONTEXT TYPE' ( 'INTEGER' | 'LONG_INTEGER' | 'REAL' | 'BOOL' | 'TEXT' | 'BLOB' ) )
           | 'IS TRUE'
           | 'CAST'
           | 'SIGN FUNCTION'
           | 'CURSOR HAS ROW'
           | 'UPDATE' 'FROM'
           | 'AND' 'OR' 'NOT' 'NULL' 'CHECK'

referenced by:


enforce_strict_stmt:

@ENFORCE_STRICT enforcement_options

enforce_strict_stmt
         ::= '@ENFORCE_STRICT' enforcement_options

referenced by:


enforce_normal_stmt:

@ENFORCE_NORMAL enforcement_options

enforce_normal_stmt
         ::= '@ENFORCE_NORMAL' enforcement_options

referenced by:


opt_use_offset:

OFFSET

opt_use_offset
         ::= 'OFFSET'?

referenced by:


blob_get_key_type_stmt:

@BLOB_GET_KEY_TYPE name

blob_get_key_type_stmt
         ::= '@BLOB_GET_KEY_TYPE' name

referenced by:


blob_get_val_type_stmt:

@BLOB_GET_VAL_TYPE name

blob_get_val_type_stmt
         ::= '@BLOB_GET_VAL_TYPE' name

referenced by:


blob_get_key_stmt:

@BLOB_GET_KEY name opt_use_offset

blob_get_key_stmt
         ::= '@BLOB_GET_KEY' name opt_use_offset

referenced by:


blob_get_val_stmt:

@BLOB_GET_VAL name opt_use_offset

blob_get_val_stmt
         ::= '@BLOB_GET_VAL' name opt_use_offset

referenced by:


blob_create_key_stmt:

@BLOB_CREATE_KEY name opt_use_offset

blob_create_key_stmt
         ::= '@BLOB_CREATE_KEY' name opt_use_offset

referenced by:


blob_create_val_stmt:

@BLOB_CREATE_VAL name opt_use_offset

blob_create_val_stmt
         ::= '@BLOB_CREATE_VAL' name opt_use_offset

referenced by:


blob_update_key_stmt:

@BLOB_UPDATE_KEY name opt_use_offset

blob_update_key_stmt
         ::= '@BLOB_UPDATE_KEY' name opt_use_offset

referenced by:


blob_update_val_stmt:

@BLOB_UPDATE_VAL name opt_use_offset

blob_update_val_stmt
         ::= '@BLOB_UPDATE_VAL' name opt_use_offset

referenced by:


expr_macro_def:

@MACRO ( EXPR ) name ! ( opt_macro_formals )

expr_macro_def
         ::= '@MACRO' '(' 'EXPR' ')' name '!' '(' opt_macro_formals ')'

referenced by:


stmt_list_macro_def:

@MACRO ( STMT_LIST ) name ! ( opt_macro_formals )

stmt_list_macro_def
         ::= '@MACRO' '(' 'STMT_LIST' ')' name '!' '(' opt_macro_formals ')'

referenced by:


query_parts_macro_def:

@MACRO ( QUERY_PARTS ) name ! ( opt_macro_formals )

query_parts_macro_def
         ::= '@MACRO' '(' 'QUERY_PARTS' ')' name '!' '(' opt_macro_formals ')'

referenced by:


cte_tables_macro_def:

@MACRO ( CTE_TABLES ) name ! ( opt_macro_formals )

cte_tables_macro_def
         ::= '@MACRO' '(' 'CTE_TABLES' ')' name '!' '(' opt_macro_formals ')'

referenced by:


select_core_macro_def:

@MACRO ( SELECT_CORE ) name ! ( opt_macro_formals )

select_core_macro_def
         ::= '@MACRO' '(' 'SELECT_CORE' ')' name '!' '(' opt_macro_formals ')'

referenced by:


select_expr_macro_def:

@MACRO ( SELECT_EXPR ) name ! ( opt_macro_formals )

select_expr_macro_def
         ::= '@MACRO' '(' 'SELECT_EXPR' ')' name '!' '(' opt_macro_formals ')'

referenced by:


op_stmt:

@OP data_type_any CURSOR NULL : loose_name loose_name_or_type AS loose_name

op_stmt  ::= '@OP' ( data_type_any | 'CURSOR' | 'NULL' ) ':' loose_name loose_name_or_type 'AS' loose_name

referenced by:


macro_def_stmt:

expr_macro_def BEGIN expr stmt_list_macro_def BEGIN stmt_list query_parts_macro_def BEGIN query_parts cte_tables_macro_def BEGIN cte_tables select_core_macro_def BEGIN select_core_list select_expr_macro_def BEGIN select_expr_list END

macro_def_stmt
         ::= ( expr_macro_def 'BEGIN' expr | stmt_list_macro_def 'BEGIN' stmt_list | query_parts_macro_def 'BEGIN' query_parts | cte_tables_macro_def 'BEGIN' cte_tables | select_core_macro_def 'BEGIN' select_core_list | select_expr_macro_def 'BEGIN' select_expr_list ) 'END'

referenced by:


opt_macro_args:

macro_arg ,

opt_macro_args
         ::= ( macro_arg ( ',' macro_arg )* )?

referenced by:


macro_arg:

expr BEGIN stmt_list END stmt_list_macro_ref FROM ( query_parts WITH ( cte_tables ALL ( select_core_list SELECT ( select_expr_list ) query_parts_macro_ref cte_tables_macro_ref select_core_macro_ref select_expr_macro_ref

macro_arg
         ::= expr
           | 'BEGIN' stmt_list 'END'
           | stmt_list_macro_ref
           | ( 'FROM' '(' query_parts | 'WITH' '(' cte_tables | 'ALL' '(' select_core_list | 'SELECT' '(' select_expr_list ) ')'
           | query_parts_macro_ref
           | cte_tables_macro_ref
           | select_core_macro_ref
           | select_expr_macro_ref

referenced by:


opt_macro_formals:

macro_formal ,

opt_macro_formals
         ::= ( macro_formal ( ',' macro_formal )* )?

referenced by:


macro_formal:

name ! macro_type

macro_formal
         ::= name '!' macro_type

referenced by:


macro_type:

EXPR STMT_LIST QUERY_PARTS CTE_TABLES SELECT_CORE SELECT_EXPR

macro_type
         ::= 'EXPR'
           | 'STMT_LIST'
           | 'QUERY_PARTS'
           | 'CTE_TABLES'
           | 'SELECT_CORE'
           | 'SELECT_EXPR'

referenced by: