Commit Graph

12 Commits

Author SHA1 Message Date
Martin Kleusberg
d85672511c Grammar: Fix parsing of NOT IN/GLOB/MATCH/REGEXP constraints
See issue #40.
2014-06-23 12:37:09 +02:00
Martin Kleusberg
9cb0614ecf Grammar: Parse NOT LIKE constraints correctly
Parse column constraints with a 'NOT LIKE' expression correctly. For
example in a table definition like this:
CREATE TABLE not_working(
    value TEXT CONSTRAINT "value" CHECK(value NOT LIKE "prefix%")
);

This fixes issue #40.
2014-06-20 12:47:20 +02:00
Peinthor Rene
b02b36b2a2 fix create table statements with IN operator
fixes issue #34
IN wasn't added to the token list and not enabled in the suffix expression
as this gives a parser generator warning, because of an ambiguity with IN as an operator
we stick with the warning right now
2014-06-11 22:48:51 +02:00
Martin Kleusberg
6e5c98b653 Grammar: Allow 'NULL' constraints
Allow NULL constraints in a column definition when parsing a CREATE
TABLE statement. Before this only NOT NULL constraints were parsed
correctly even though NULL is proper SQL as well - it's just a redundant
information.
2014-06-04 20:50:08 +02:00
Martin Kleusberg
3761acfd02 Extend SQL grammar to recognise 'without rowid' tables correctly
Since version 3.8.2 SQLite supports tables without the internal rowid
column added to the table. For these tables the primary key serves as a
replacement for the rowid column.

These changes update the grammar parser to correctly handle 'without
rowid' tables and also generate 'without rowid' SQL statements.
2014-05-09 14:46:42 +02:00
Peinthor Rene
d2246b79d7 grammar: fix column constrain
DEFAULT also takes quoted literals
2014-04-28 21:22:32 +02:00
Peinthor Rene
fd89ef72a6 Fix an issue with keywords in table or column names
note: table names are a bit more restrictive than column names
And btw. you can always have any name you want, just put it in quotes.
2013-11-24 10:23:55 +01:00
Peinthor Rene
e80f445c53 grammar: fix ambiguous string literal lexer part 2013-07-18 15:44:39 +02:00
Martin Kleusberg
ed04128a74 Grammar: Support table names in single quotes
Don't fail when parsing a CREATE statement like this:
CREATE TABLE 'test' (id INT);
2013-06-23 22:16:13 +02:00
Peinthor Rene
0861f51897 updated sqlite parser 2013-05-03 21:11:21 +02:00
Peinthor Rene
ba6d51edf2 fix all warnings in the grammar and some bugs
literals were case sensitive so lower keywords broke parsing
2013-03-22 15:50:04 +01:00
Peinthor Rene
5737925079 Add a sqlite3 antlr2 "create table" grammar + generated parser files
There is also a "create table" ast walker which fills
info for the new sqlitetype objects.
A dependency to the antlr2 runtime was added.
The grammar most probably still contain bugs.
Why all this?
First writing grammars is fun and this is the only way
we can get all information for proper table editing + some time
in the future when the grammar is finished we can provide real
auto completion.
2013-03-16 20:18:57 +01:00