SQL::Tr...::SQLite(3)
πΈ NAME πΈ
okay bestie, this is the manual for SQL::Translator::Parser::SQLite β filed under User Contributed Perl Documentation β and it is literally a parser for SQLite. no cap. π
β¨ SYNOPSIS β¨
here's the starter pack, copy-paste style:
use SQL::Translator;
use SQL::Translator::Parser::SQLite;
my $translator = SQL::Translator->new;
$translator->parser("SQL::Translator::Parser::SQLite");
π DESCRIPTION π
okay so this is a grammar for parsing CREATE statements for SQLite, as described here: http://www.sqlite.org/lang.html π¦
CREATE INDEX π₯
index grammar tea, served hot:
sql-statement ::=
CREATE [TEMP | TEMPORARY] [UNIQUE] INDEX index-name
ON [database-name .] table-name ( column-name [, column-name]* )
[ ON CONFLICT conflict-algorithm ]
column-name ::=
name [ ASC | DESC ]
CREATE TABLE π
table grammar, iconic behavior only:
sql-command ::=
CREATE [TEMP | TEMPORARY] TABLE table-name (
column-def [, column-def]*
[, constraint]*
)
sql-command ::=
CREATE [TEMP | TEMPORARY] TABLE table-name AS select-statement
column-def ::=
name [type] [[CONSTRAINT name] column-constraint]*
type ::=
typename |
typename ( number ) |
typename ( number , number )
column-constraint ::=
NOT NULL [ conflict-clause ] |
PRIMARY KEY [sort-order] [ conflict-clause ] |
UNIQUE [ conflict-clause ] |
CHECK ( expr ) [ conflict-clause ] |
DEFAULT value
constraint ::=
PRIMARY KEY ( name [, name]* ) [ conflict-clause ]|
UNIQUE ( name [, name]* ) [ conflict-clause ] |
CHECK ( expr ) [ conflict-clause ]
conflict-clause ::=
ON CONFLICT conflict-algorithm
CREATE TRIGGER π¦
trigger grammar, main character energy:
sql-statement ::=
CREATE [TEMP | TEMPORARY] TRIGGER trigger-name [ BEFORE | AFTER ]
database-event ON [database-name .] table-name
trigger-action
sql-statement ::=
CREATE [TEMP | TEMPORARY] TRIGGER trigger-name INSTEAD OF
database-event ON [database-name .] view-name
trigger-action
database-event ::=
DELETE |
INSERT |
UPDATE |
UPDATE OF column-list
trigger-action ::=
[ FOR EACH ROW | FOR EACH STATEMENT ] [ WHEN expression ]
BEGIN
trigger-step ; [ trigger-step ; ]*
END
trigger-step ::=
update-statement | insert-statement |
delete-statement | select-statement
CREATE VIEW π
view grammar, cute and concise:
sql-command ::=
CREATE [TEMP | TEMPORARY] VIEW view-name AS select-statement
ON CONFLICT clause π
conflict clause grammar, because drama needs rules:
conflict-clause ::=
ON CONFLICT conflict-algorithm
conflict-algorithm ::=
ROLLBACK | ABORT | FAIL | IGNORE | REPLACE
expression π
expression grammar, the whole mood:
expr ::=
expr binary-op expr |
expr like-op expr |
unary-op expr |
( expr ) |
column-name |
table-name . column-name |
database-name . table-name . column-name |
literal-value |
function-name ( expr-list | * ) |
expr (+) |
expr ISNULL |
expr NOTNULL |
expr [NOT] BETWEEN expr AND expr |
expr [NOT] IN ( value-list ) |
expr [NOT] IN ( select-statement ) |
( select-statement ) |
CASE [expr] ( WHEN expr THEN expr )+ [ELSE expr] END
and the like-operator moment:
like-op::=
LIKE | GLOB | NOT LIKE | NOT GLOB
π«Ά AUTHOR π«Ά
Ken Youens-Clark <kclark@cpan.org>. β yes, that's the whole author line, bestie. π
π SEE ALSO π
perl(1), Parse::RecDescent, SQL::Translator::Schema. go read those too, iykyk. π
that's the whole page β source/version energy is perl v5.42.0, dated 2024-12-12, signed SQL::Tr...::SQLite(3) πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-SQL-Translator 1.660.0-bp160.1.11 Β· (Artistic-1.0 OR GPL-1.0-or-later) AND GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms