Commit Graph

484 Commits

Author SHA1 Message Date
Martin Kleusberg
8c86a01faf EditTableDialog: Don't change the cursor when renaming the table
Renaming a table doesn't take a lot of time hence no need to change the
cursor.
2013-05-25 17:22:20 +02:00
Martin Kleusberg
f3ae25572d DBBrowserDB: Remove the dirty flag
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.
2013-05-23 18:16:58 +02:00
Martin Kleusberg
6de8425985 VacuumDialog: Fix dialog after savepoint change
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.
2013-05-23 18:09:09 +02:00
Martin Kleusberg
7f03e01a86 ImportCsvDialog: Also use the new savepoint logic in this dialog
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.
2013-05-23 18:04:27 +02:00
Martin Kleusberg
a1b72c5eef Extend the entire savepoint logic to allow multiple active savepoints
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!
2013-05-23 17:41:16 +02:00
Martin Kleusberg
4dfabe4a78 VacuumDialog: Add dialog to allow compacting single objects individually
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.
2013-05-21 22:32:05 +02:00
Martin Kleusberg
6f8e988f10 Also enable extension loading when creating a new database 2013-05-21 21:01:19 +02:00
Martin Kleusberg
929bb9026d SqlTextEdit: Support opening files by drag and drop
When dropping a file on the editor widget try to open and read it.
2013-05-17 15:05:21 +02:00
Martin Kleusberg
c0e6d251d5 MainWindow: Show execution time in SQL tab
Show the time needed for executing a statement in the result box.

Generally fix some minor problems with the result view.
2013-05-17 14:56:58 +02:00
Martin Kleusberg
c251a001a1 DBBrowserDB: Fix transaction logic in execute{Multi}SQL
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.
2013-05-17 14:39:42 +02:00
Martin Kleusberg
606b5bd953 SqlExecutionArea: Show status messages in text edit instead of label 2013-05-17 14:35:20 +02:00
Martin Kleusberg
5a3cfda826 SyntaxHighlighter: Add SQLite functions
Also highlight the names of functions supported by SQLite such as COUNT.
2013-05-16 21:16:37 +02:00
Martin Kleusberg
d2f1db8457 SyntaxHighlighter: Make keyword list a bit easier to read 2013-05-16 21:05:06 +02:00
Martin Kleusberg
04b431d3f1 Add rough implementation of some command line options
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.
2013-05-14 18:12:11 +02:00
Martin Kleusberg
6ba0cd76c0 Open database correctly when importing into a new file
When doing a SQL import into a new database file open this file
correctly after the import.
2013-05-10 13:29:49 +02:00
Martin Kleusberg
11a2d321d8 Don't set dirty flag after SQL import to new DB file
When creating a new database to import a SQL file into don't set the
dirty flag.
2013-05-10 13:21:52 +02:00
Martin Kleusberg
729773d345 Fix SQL import file name logic
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.
2013-05-10 13:15:06 +02:00
Martin Kleusberg
5a3658cad2 DBBrowserDB: Show progress dialog in executeMultiSQL()
Show a progress dialog when executing multiple SQL statements. This
mainly affects the SQL import.
2013-05-10 12:58:46 +02:00
Martin Kleusberg
5536c13a06 DBBrowserDB: Export BLOBs correctly
When creating an SQL dump also export BLOB data correctly.
2013-05-09 18:47:32 +02:00
Martin Kleusberg
cf0a0339eb MainWindow: Replace icon for the SQL log window
Replace the icon used in the action for toggling the SQL log
dock/window.
You might need to delete your makefiles before building this.
2013-05-09 18:34:33 +02:00
Martin Kleusberg
90d423c66f DBBrowserDB: Don't export sqlite_stat1 table when dumping DB
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.
2013-05-09 18:18:18 +02:00
Martin Kleusberg
1c19defbe9 ExtendedTableWidget: Always scroll per pixel horizonzally
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.
2013-05-09 18:05:25 +02:00
Martin Kleusberg
1e89d1914e Update .desktop file 2013-05-09 14:19:20 +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
Martin Kleusberg
cf72bfbb1c MainWindow: Improve SQL tab behaviour
Don't allow opening and saving when no database file is opened.

Close all tabs when the database is closed.
2013-05-08 21:50:35 +02:00
Martin Kleusberg
f3f340f83e Add single step execution to the SQL tab
Add a new action to allow the execution of the SQL statement in the
current line. This also supports multi-line SQL statement.
2013-05-08 21:44:08 +02:00
Martin Kleusberg
a39325830c MainWindow: Don't use bold print for write and revert actions
At least for me it looks a bit odd to use a bold font for these actions.
They are not that much more important than the other ones.
2013-05-08 21:19:02 +02:00
Martin Kleusberg
74bdfee384 SqliteTableModel: Return from setData() if value hasn't changed
Don't do any changes to the database if the value hasn't actually
changed. This avoids settings the dirty flag when there is no need to.
2013-05-07 20:51:07 +02:00
Martin Kleusberg
ea31c8023b SqliteTableModel: Don't show binary data in table widgets
Don't show BLOBs as binary data in table widgets, instead put a "BLOB"
text in that cell.

Also make BLOBs not editable unless you use the edit dialog.
2013-05-07 20:47:16 +02:00
Martin Kleusberg
09afe637c6 MainWindow: Don't open new SQL tab when the current one is empty
When opening an SQL file don't open a new tab for it when the current
one is completely empty and could be used just as well.
2013-05-07 20:33:04 +02:00
Martin Kleusberg
d6ed7e932f Show error message when changing table data fails
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.
2013-05-07 20:25:35 +02:00
Martin Kleusberg
432180ec03 SqlTextEdit: Show line numbers
Show line numbers in the SqlTextEdit widget. This code is based on the
CodeEditor example from the Qt documentation.
2013-05-07 20:16:17 +02:00
Martin Kleusberg
61ee8b4871 MainWindow: Fix menu entry for log dock widget
Simplify the log window handling a little bit.

Fix a bug that caused the log window to disappear when the window was
minimised.
2013-05-06 19:11:06 +02:00
Martin Kleusberg
ef5f88cc70 SqlExecutionArea: Implement save as view function
Add a menu item to allow saving the results of a query a new view.
2013-05-06 18:59:46 +02:00
Martin Kleusberg
9536e7a095 SqlExecutionArea: Support exporting result to CSV file
Add a button which allows the user to save the query results to a CSV
file.

Add some basic preparations for saving the result as a view.
2013-05-06 18:44:58 +02:00
Martin Kleusberg
e548becda1 SqlExecutionArea: Use Qt Designer for layout design 2013-05-06 18:17:59 +02:00
Martin Kleusberg
16d533999d Make result table in SQL tab non-editable 2013-05-06 17:35:39 +02:00
Martin Kleusberg
65b1adf845 Also load extensions when creating a new database
Also load the default extensions when creating a new database.

When opening a database load the extensions before reading the structure
and the pragmas because the extensions could affect those.
2013-05-04 21:27:36 +02:00
Martin Kleusberg
0de7ff8564 SqlTextEdit: Highlight current line 2013-05-04 21:10:50 +02:00
Peinthor Rene
a95d33e5ee add unittest for foreign key parser problem 2013-05-03 21:12:56 +02:00
Peinthor Rene
0861f51897 updated sqlite parser 2013-05-03 21:11:21 +02:00
Peinthor Rene
32ba32bbae add missing tokens
I hope I got all now
2013-05-03 21:10:10 +02:00
Martin Kleusberg
33d3dcdc16 Fix extension loading 2013-05-03 16:11:35 +02:00
Martin Kleusberg
93ebc68436 Update README 2013-05-03 16:04:09 +02:00
Martin Kleusberg
2d8cad27eb PreferencesDialog: Add new tab for extension loading
Add new settings to preferences dialog for automated loading of
extensions for all databases.
2013-05-03 16:01:52 +02:00
Martin Kleusberg
e36b17a485 Add support for SQLite extension loading
Enable the extension support in SQLite.

Add code to allow loading of extension.

Add menu entry for easy extension loading.
2013-05-03 15:26:34 +02:00
Martin Kleusberg
a031386edd Fix filter row SQL generation to always produce correct SQL statements
Always produce correct SQL statements, even when using an incomplete
comparison operator.

Fix escaping to make it possible to search for '-charachters.
2013-05-03 13:34:26 +02:00
Martin Kleusberg
9d8cfaa8cf Remove filter row when closing database file
Remove the filter row in the browse tab when closing the database.
Before this it would remain visible leading to a crash when using it.
2013-05-03 13:20:20 +02:00
Martin Kleusberg
971a4051db Update README 2013-05-03 12:17:46 +02:00
Martin Kleusberg
d52a6be86f Add buttons to open and save SQL files to SQL tab in main window 2013-05-03 12:13:17 +02:00