Change the approach to count the total number of rows returned by an SQL
query to also support EXPLAIN and PRAGMA statements. These failed before
because you are not allowed to put them into a COUNT query. This commit
adds the code needed to count the number of rows manually when one of
these queries is executed.
Fix a bug in SqliteTableModel that caused the application to crash when
the SQL query contained a semicolon somewhere in the middle of the
string. This was caused by an error in the rtrimChar function which
returned everything left of the first semicolon. The new implementation
only removed trailing characters.
Allow setting the default value, the check values and under some
circumstances the not null flag when editing existing tables.
This required some changes to DBBrowserDB::renameColumn() which is now
using some more features of sqlitetypes.cpp but could still be improved.
Restore the possibility to change the data type of a column of an
existing table - a feature we lost some time ago.
Also change the updateTypes() method to not actually update the types of
all columns when only one can be changed at a time.
Make it possible to rename the columns of already existing tables using
the EditTableDialog. This is a feature we lost somewhere around commit
b36800ea02.
Remove the dirty flag as it is no longer needed. Because we track the
savepoints currently held open we can just use that list to see wether
there are changes to be committed. So there is no need to track this in
a separate variable.
Call saveAll() in the VacuumDialog to make sure to release all savepoints.
Also cancel the dialog when no object was select but the OK button
clicked. This avoids an unnecessary DB reload in the main window.
Do just the same in the ImportCsvDialog as before in the
EditTableDialog, i.e. using a unique savepoint name which is not
released when the import was successfull.
Allow multiple savepoints in DBBrowserDB, i.e. setRestorePoint() doesn't
simply return if the DB is already set to dirty but creates an
additional savepoint.
Track the names of all savepoints which have not been either saved or
reverted yet.
Finally, and that's the whole point of this commit, change the savepoint
logic of the EditTableDialog. We used to have a transaction started when
opening a database which was only committed when the file was closed
again. This way the EditFileDialog could savely create a savepoint when
being opened and just release it when OK was clicked or revert to it
when cancel was clicked. Getting rid of the transaction broke this
logic. The dialog still worked but as the savepoint was released when
the changes were applied all changes made via the dialog were
immediately committed to the database. So clicking the revert button had
no effect on those changes. This is at best an unexpected behaviour but
could also be a problem when some changes are reverted while others
aren't. So, having the option now of keeping multiple savepoints opened
this problem can be fixed by just creating a new savepoint every time
the dialog is opened, reverting to it when it is cancelled and _not_
releasing it when OK is clicked.
I hope this works!
Add a new dialog which is shown when compacting the database. This
dialog allows selecting single objects individually to avoid vacuuming
the entire database.
It also shows a new warning if the database is dirty as changes are
going to be saved before vacuuming.
Create a restore point in executeSQL and executeMultiSQL instead of just
setting the dirty flag. This way the changes made using these functions
are not applied immediately when no restore point was created yet.
Support some additional command line options for opening and running SQL
scripts directly.
Don't just take the first argument as a SQLite database to open as it
could be a command line option - Qt and X11 have some default ones.
Don't ask the user wether to create a new DB or use the current one if
no database is opened anyway.
Don't start the import when the save dialog was cancelled.
When creating a SQL dump of the database don't export the sqlite_stat1
table as it's impossible to import it later because SQLite generates it
automatically.
Always use per pixel scrolling when scrolling in horizontal direction.
This changes the scrolling in the SqlExecutionArea and makes some
settings in the MainWindow dispensable.
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.
Give the user an error message when setting new data for a cell fails.
This is especially useful when the problem is caused by foreign key
constraints.