Allow opening new tabs, opening SQL files, and saving SQL files even
when no database is opened. Execution of SQL statements obviously is
still not allowed. But this should make it possible to use DB4S as a
simple SQL text editor if no better alternative is available on the
system.
Don't close SQL tabs when closing the databse.
When opening a database only close empty tabs, keep all non-empty tabs
opened. This should make sure that no SQL statements are accidentally
lost when opening a new database or simply closing the old one.
When opening a project file, close all tabs and load the new tabs from
the project file.
See issue #1035.
Don't allow removing expression columns by double clicking as this it
too error-prone. Instead require a button click for removal and only
start editing the expression when double clicking.
See issue #1012.
Add a context menu to all table view widgets in the program (Browse Data
tab and Execute SQL tab) which opens when right clicking a table item.
Currently the menu only allows you to copy and paste the selected
item(s).
Only activate the paste action when the current view is writable.
Browsing WITHOUT ROWID tables was broken since a couple of commits. An
error message would be printed to the console and all cells would stay
empty. This is fixed by this commit.
When pasting data into a cell of a view the application would have
crashed because it treats the view as a table (which it isn't). This is
fixed by this.
- Tweak input checker
- Preserve old file import as not to cause any unforeseen breaks
- Allow ignoring file name when importing multiple files to tables
- Mass toggle several files for import
Add a button for adding new expression columns to the Edit Index dialog.
Allow the user to edit the 'name' of existing expression columns in the
Edit Index dialog.
This adds a new field to the Edit Index dialog that allows the user to
change the partial index expression for an index.
Example:
CREATE INDEX i ON a(
col1 ASC,
col2 DESC
) WHERE id < 1000; -- This bit here
Change the layout of the dialog entirely. Instead of having checkboxes
that, if activated, move a column into the index, use two separate table
views, one for available columns and one for used columns. This makes it
easier to see the index structure on first sight. It also makes it
possible to see the order of the different index columns from the table
views. Additionally, now expression columns that are used in the index
are shown in the table views, even allowing them to be removed from the
index.
Don't show the "Show rowid column" context menu item for views because
views don't really have a rowid column (it's always NULL). So showing
the column doesn't really make a lot of sense and might even confuse
some users.
Also change the order of the menu items a little to be more consistent
for views and tables.
This adds a new context menu option that allows unlocking views for
updating. This requires appropriate triggers to be in place and the user
to type in a column name that can be used as a 'primary key' for the
view. By default views are still locked from editing.
Inserting into and deleting from views isn't supported yet.
See issue #141.
When possible, don't write 'CREATE TABLE/VIEW/... `name`' but 'CREATE
TABLE/VIEW/... IF NOT EXISTS `name`' to the file.
Add an option to add DROP TABLE statements before each create statement.
This needs to be enhanced to apply to views, indices, and triggers as
well. See issue #629.
Clean up code.
When creating a new database we execute a couple of SQL statements after
opening the new file. However, since none of them happen in a
transaction there's no need to commit them. This change gets rid of the
commit statement and avoids a warning being printed by doing so.
See issue #583.
In the plot code use the blockSignals() method instead of connecting and
disconnecting signals and slots every time. The disconnects didn't
really work using the new C++11 connection code, so this commit restored
the functionality as it was intended.
This means that *a ton* of calls to updatePlot() are eliminated which
improves the performance.
It also avoid messing up the graph selection table in the Plot Dock in
certain cases.
See issue #950.
This reverts commit 6da71b6788.
This was causing just too many problems for one. The ones I noticed
were:
- Messing up the table view when scrolling down very large table where
the prefetching code is triggered.
- Crashing when setting an auto increment PK in the Edit Table dialog
because the sqlitetablemodel is used for a check in there.
- Probably more crashed in other places but for the same reason.
- Easy to fix but an issue nonetheless: when doing plotting a number of
empty rows would be inserted into the data browser.
- It just feels a little laggy.
When browsing a table and changing the sort order, then switching to
another table, and then switching back, we would sort the table twice:
once using the default sort order and then again using the previously
used sort order. This results in four instead of two queries for those
tables (including the COUNT queries). This commit fixes this so that
only two queries are executed which should cut the run time for these
cases in half.
See issue #1007.