The Clear Filters button is enabled if and only if there is some filter
set for the browsed table.
The Clear Sorting button is enabled if and only if the table is sorted by
some column.
See issue #2616
"Yes" to not be prompted next time for the same table, but yes for different
tables.
"Yes to All" to not be prompted again for any existent tables.
See issue #2633
* Add auto completion for math functions
Math functions are introduced from sqlite 3.35.
Refer https://www.sqlite.org/lang_mathfunc.html
FYI, it need to compile sqlite with -DSQLITE_ENABLE_MATH_FUNCTIONS
* Add auto completion for math function when it had been enabled
Math function can be used when sqlite is equal or higher than 3.35 and
compiled with SQLITE_ENABLE_MATH_FUNCTIONS. When sqlite is compiled with
SQLITE_OMIT_COMPILEOPTION_DIAGS, there is no way to check the compile
options. In this case, we'll check only the sqlite version. Otherwise,
it will check whether sqlite was built with SQLITE_ENABLE_MATH_FUNCTIONS.
This commit replaces the regular expressions for removing end of line
and block comments from SQL queries provided by the user by a hand
written state machine. This makes the code a lot faster, especially for
longer SQL scripts with many statements and many comments in them. It is
also not harder to read than the rather complex regular expressions from
before - possibly even easier to read.
See issue #2619.
In this case too, the corresponding menu entry for exporting the query
results to JSON was missing although it was straight forward to add it
with the same scheme as for CSV.
Renamed the CSV action for consistency.
Related to issue #2607
This check was supposed to help the user understand what this operation was for,
but it was actually preventing to save as view table states that had global
filter, display formats or custom order and not column filters. It's better to
give the user the freedom, even to create maybe useless vies as:
`CREATE VIEW "example_view" AS SELECT * FROM "main"."example"`
See issue #2615
This fixes a bug introduced in 73efa11680.
Because SQLite reports ALTER TABLE statements to return one column worth
of data, DB4S assumed they are close to a SELECT statement and therefore
did not fully execute them.
See issues #2563 and #2622.
The corresponding menu entry for exporting the query results to JSON was missing
although it was straight forward to add it with the same scheme as for CSV.
Related to issue #2607
Support these settings from the command line:
--option importcsv/separator=\, --option importcsv/quotecharacter=\'
Since they are stored as string, they cannot convert to QChar unless
manually converted.
See issue #2589
This will allow associating DB4S to CSV files and dropping a CSV file to be
importing into a new in-memory database, when there is no DB open yet.
See issue #2589
The argument can be passed several times and all the CSV files are added to
the Import CSV dialog. When no database to open is passed in the command line,
the CSV files are imported into a new in-memory database, which could later
be saved as a file, if desired.
This option could be used as basis for adding a file association to CSV files
for DB4S.
See issue #2589.
- Command line arguments are not given to translations, only descriptions
and placeholders.
- Formatting is done programmatically, so developers and translators don't
have to adjust that themselves.
This will affect translations but will be better in the long run.
This fixes some severe bugs in the Browse Data tab with editing and
deleting rows in WITHOUT ROWID tables.
These were introduced in 02db68107a.
See issue #2582.
This improves the performance of executing multiple modifying SQL
statements, like INSERTs or UPDATEs, in the Execute SQL tab a lot by
not updating the plot dock after every single statement.
See issue #2572.
This commit does a lot of refactoring. But most noticeably it changes
two things:
1) Instead of saving all objects (tables, views, indices, triggers) of a
schema in a common map, we now store tables/views, indices and
triggers in three separate maps. This has a number of benefits:
- It resembles more closely how SQLite stores its data internally and
therefore achieves greater compatability e.g. for databases with a
view and a trigger with the same name.
- It reduces the need for runtime polymorphism. This makes the code
run a bit faster.
- By working with explicit types more often more error checking can
be done at compile time, making the code less error prone.
- The code becomes a lot clearer to read.
2) By making View inherit form Table, views are now a sort of tables.
This has the following benefits:
- This is a again how SQLite stores views internally which again
should increase compatibility a bit.
- We mostly treat views and tables the same anyway and with these
changes we can unify the code for them even more.
For the same reasons we changed the ORDER BY part of query objects to
use their names instead of their indexes to address columns, this commit
changes the handling of the WHERE part of a query to use column names
too.
This changes the structures for representing SELECT statements to save
the names of sorted column instead of their indexes. This change has
several benefits:
- It prepares the Query class to store actual real-world SELECT
statements in the future.
- It prepares us to sort by expressions instead of just columns.
- This way we do not need an extra list of column names to generate the
ORDER BY part of the SELECT statement when building it.
This simplifies the usage and the implementation of the SqliteTableModel
a bit by making the two operating modes it supports (manual query and
interactive query) more obvious in its public interface as well as
simplifying the control flow in the private implementation.
Change some function parameters which are named like "dont..." to make a
positive statement. This should hopefully avoid some confisions with
double negation.
The feature is implemented using the SQLite backup API.
https://sqlite.org/backup.html
This allows saving in-memory databases and saving database files to another
file name.
When opening a database and clicking on a table in the Database
Structure tab, the buttons for modifying or deleting the table were
still disabled. Only on the second click activated the buttons
correctly.
See issue #2528.
This fixes two issues when executing SQL statements:
- When reusing a model object the row count was not reset. This meant
that when the second query returned less rows than the first a bunch
of "loading..." cells were still visible.
- The workaround for making sure the plot dock was only updated when the
data was ready (instead of just the row count), now that the data is
ready before the row count, would stop the worker thread from ever
finishing.
See issue #2535.
This partially reverts 89587a7d67 to fix
some issues it introduced. Using the knowledge we gained in the further
optimisation process, this commit now gets us the best of both worlds:
good performance when executing complex queries as well as a more
straightforward way to deal with the multithreaded nature of data
loading.
See issue #2537.
In MainWindow::closeEvent() now it calls Settings::sync() to call
QSettings->sync(). Qt documentation
(https://doc.qt.io/qt-5/qsettings.html#sync) says:
"This function is called automatically from QSettings's destructor and
by the event loop at regular intervals, so you normally don't need to
call it yourself."
On my Linux machine QSettings was not syncing to the
~/.config/sqlitebrowser/sqlitebrowser.conf (e.g. if I was doing View ->
Window Layout -> Simplify Window Layout and then close quickly was not
saved). Other settings recently changed before exiting would have been
the same.
Note that Settings is fully static so this seems to be an easy fix.