Add some basic initial support for SQLCipher. Note that this is more of
a POC than a final implementation.
This commit adds an option called 'sqlcipher' to the cmake and qmake
projects which - when enabled - replaces the default SQLite3 include and
library files by their SQLCipher counter-parts. Especially on MacOS X
there might be some more work required in finding the correct include
paths. The SQLCipher library supports unencrypted databases, too, so
even if the option is enabled the program behaves like before. You can
see the difference, though, in the About Dialog where the SQLite version
string will say 'SQLCipher version xy'.
When the sqlcipher option is enabled and you try to open a file which is
neither a project file nor a normal SQLite3 database it is assumed now
that the file is an encypted database. There is no way to tell between
an invalid file and an encypted file, so in both cases a password dialog
pops up. When the correct password and page size are entered the file is
opened and can be edited like any other database before.
Creating encrypted databases isn't supported yet. So for testing you
need to fall back to the sqlcipher command line tool.
See issue #12.
When hovering over an item in the tree views of the Database Structure tab
or DB Schema pane, show a tooltip with the contents of that field.
See issue #139.
Add an option to the preferences dialog (by default disabled) which,
when activated, removes all line breaks from the Schema column in the
Database Structure tab and the DB Schema pane. Especially if there are
many tables this might make things clearer.
In the Database Structure tab of the main window and the DB Schema
pane, show more information in the field nodes of the tree view. This
commit puts the field definition in the Schema column which has been
unsused until now. It also changes the icon of the field row when the
field is a primary key. This hopefully makes the Schema view a bit more
useful, especially in the pane.
Commit c29702a1b9 fixed the handling of
default values and added a check to enforce quote characters when they
are needed. This check wasn't prepare for empty default values (i.e. no
default value) and would add quote characters in this case, too. This is
fixed by this commit.
See issue #133.
SQL allows you to use two quote characters instead of just one in order
to escape them. Example: ['aa''bb'] is read as [aa'bb]. Add detection
for these doubled quote characters to our grammar parser.
See issue #128.
When saving a project file make sure it's got the right file ending.
Also add it to the list of recently opened files.
Use the default location from the preferences dialog for initialising
the file dialogs for loading and saving project files.
Fix the handling of default values in the Edit Table dialog by doing two
things: First, change the sqlb::Field class so that it doesn't put quotes
around any default values no matter what. This breaks for example NULL
default values but also causes invalid syntax if the default value is
already in quotes. Secondly, change the Edit Table dialog itself to
double check if the user should've put quotes around their default value
but hasn't. In this case add them automatically.
See issues #64 and #126.
First apply the new filter values and only when that is done get the
number of rows in the current view. This fixes the issue that, when
changing a filter, the number of rows shown under the table view is that
of the last results, not the current.
See issue #122.
Add a new menu option which allows attaching other databases. Doing so
by running the SQL code by yourself using the Execute SQL tab won't work
because the SQL tab creates a restorepoint and attaching databases while
being in a transaction is not allowed.
Note that this commit misses quite a few features: In case of name
conflicts the UI may break, there is no way to tell which databases have
been attached and the attached databases are not stored in the project
files.
See issue #100.
No need to update the progress window after each row. It's only really
visible for large files anyway where a single row doesn't matter that
much in terms of progress.
Also fix a compiler warning.