Commit Graph

17 Commits

Author SHA1 Message Date
Peinthor Rene
c106e82f77 grammar: forgot to update the AST treewalker too 2014-04-28 21:31:47 +02:00
Peinthor Rene
9ce88b8619 show the statement failed to parse 2014-02-12 19:17:55 +01: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
afc53f72c6 grammar: support string identifiers 2013-07-19 14:09:10 +02:00
Martin Kleusberg
63cf871017 SqliteTypes: Move PK flag from table to field
Store the primary key flag(s) inside the sqlb::Field objects instead of
the sqlb::Table object. Technically this doesn't make a lot of sense but
then again it makes things a lot easier for us. So this should fix quite
a few issues in the entire program, especially - again - in
renameColumn(). It also magically fixes createColumn() which had no
chance of guessing which column should be a PK prior to this.

To benefit from these changes the EditTableDialog has changes as well.
- It should now be possible to set and unset PK and AI flags and they
  are actually saved.
- Setting the AI flag automatically sets the data type to Integer
  because that's the only type SQLite can handle in an autoincrement
  field.
- Clicking on the entry in the data type combobox which is currently
  selected doesn't update the DB anymore.

This commit also makes some changes to the unit tests to reflect the API
changes made. But it also adds missing quote characters in some
verification strings.

I hope this is a worthy 500th commit - at least it's got a long commit
message...
2013-06-03 20:15:29 +02:00
Martin Kleusberg
928a957e70 SqliteTypes: Allow non-numeric default values
Fix the sqlb::Field class to support non-numeric default values by
putting them in quotes.
2013-06-02 17:16:35 +02:00
Martin Kleusberg
5b9d5cc40b Remove some debug messages. Change some error messages..
Remove some useless debug messages, e.g. because they just print an SQL
string which you can see in the SQL log window anyway.

Change some "critical" errors messages to just warning. No sense in
printing a critical error message when the program can handle the
problem by itself.
2013-05-08 22:03:04 +02:00
Peinthor Rene
ed9941ac5e proper quote field names 2013-03-29 14:50:34 +01:00
Peinthor Rene
c6d5391672 don't insert nulls into columns with a default 2013-03-25 06:41:52 +01:00
Peinthor Rene
be239d0f05 make the empty insert statement work in pk + not null situations 2013-03-24 21:53:01 +01:00
Peinthor Rene
0d601c03f1 add emptyinsertstm function to table object
creates an empty insert statement for the table fields
2013-03-24 21:20:49 +01:00
Peinthor Rene
f75b361581 add method to easily remove fields from table 2013-03-22 15:51:44 +01:00
Peinthor Rene
8b8cc32c57 remove parenthesis from check constraint 2013-03-19 17:18:52 +01:00
Peinthor Rene
1b0d5a2ff9 Fix view updating after remove field in edittable dialog
rename the FieldList typedef to FieldVector
use a object instead of a table pointer in edittable dialog
2013-03-19 17:18:52 +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
Peinthor Rene
2920697894 add setter and a datatype list 2013-03-03 22:12:16 +01:00
Peinthor Rene
9394caffa9 add classes for a new sqlite field and table objects
plus a unittest build mode
2013-02-28 17:15:03 +01:00