Commit Graph

3529 Commits

Author SHA1 Message Date
Justin Clift
d68c396f5d Update currentrelease for 3.12.1 release 2021-02-21 14:23:18 +11:00
mgrojo
09aaaccace Import: Add import-csv option to command line to import CSV files
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.
2021-02-20 19:07:52 +01:00
mgrojo
3ad352467c Better formatting of the help messages so they are easier to translate
- 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.
2021-02-20 16:10:00 +01:00
Justin Clift
03297e769b Merge pull request #2585 from ismaelresp/patch-1
Fixed C++14 requirement in BUILDING.md
2021-02-13 02:59:47 +11:00
Ismael Rodriguez Espigares
8342f96d67 fixed C++14 requirement in BUILDING.md
fixed C++14 requirement from version 3.12.1 instead of 3.9.1
2021-02-12 15:16:13 +01:00
Martin Kleusberg
1c0cf443b5 Fix editing of tables without rowid
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.
2021-02-08 18:45:00 +01:00
Martin Kleusberg
73efa11680 Speed up executing SQL statements in the Execute SQL tab
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.
2021-02-03 19:16:50 +01:00
mgrojo
1e2853bfea 'Continuous build' is marked as 'Latest Release' and not as 'Pre-release'
The change in behaviour was due to
8142d461ab

See issue #2566
2021-02-01 23:08:56 +01:00
Martin Kleusberg
070bfd38cf Add extra border to make frozen table columns more obvious
This adds an extra border between frozen and ordinary table columns in
the Browse Data tab.

See issue #1888.
2021-01-31 20:33:27 +01:00
Martin Kleusberg
02db68107a Refactor the way we store a database schema
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.
2021-01-30 20:47:31 +01:00
Martin Kleusberg
13ab455d5c Unify handling of views and tables in SqliteTableModel a bit
This also avoids querying the column names another time when browsing a
view.
2021-01-28 22:42:39 +01:00
Martin Kleusberg
18c7e9c477 Change WHERE clauses of queries to use column names instead of indexes
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.
2021-01-28 20:06:49 +01:00
Martin Kleusberg
94023a55e8 For sorted column remember column name instead of column index
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.
2021-01-28 20:05:46 +01:00
Martin Kleusberg
f6ebc74131 Fix e54664dd03
Fix an error introduced in e54664dd03.
2021-01-26 19:21:22 +01:00
Justin Clift
5c5ab1f9c7 Update SQLCipher to version 4.4.2 2021-01-26 14:42:46 +11:00
Martin Kleusberg
a6d48f1ae4 Simplify interface and implementation of SqliteTableModel
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.
2021-01-25 18:13:49 +01:00
Martin Kleusberg
e54664dd03 Change some function parameters with negated name
Change some function parameters which are named like "dont..." to make a
positive statement. This should hopefully avoid some confisions with
double negation.
2021-01-24 10:20:50 +01:00
vlakoff
06200bfb44 Some fixes to the French translation 2021-01-23 12:25:45 +01:00
mgrojo
c8cd858699 Add "Save Database As..." action
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.
2021-01-22 23:54:26 +01:00
Martin Kleusberg
42ce8995c8 Fix build for Qt versions older than 5.10 2021-01-22 16:47:00 +01:00
Martin Kleusberg
7382ed882b Fix build on Qt 5.5 2021-01-22 15:35:51 +01:00
Martin Kleusberg
b3d30cad4b Enable buttons for editing/deleting tables and similar on first click
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.
2021-01-22 14:56:26 +01:00
Martin Kleusberg
367665e7f5 Fix issues with executing SQL statements
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.
2021-01-22 14:38:36 +01:00
Martin Kleusberg
329c07e0b2 Fix a ton of warnings from clang, clazy, cppcheck, etc. 2021-01-22 14:38:35 +01:00
Justin Clift
3e06b2e4f9 Add C++14 to our macOS BUILDING instructions 2021-01-20 15:40:36 +11:00
Justin Clift
cdf6db2fc0 Add C++14 support to our macOS nightly builds 2021-01-20 15:38:08 +11:00
Martin Kleusberg
36048d57f3 Rework 89587a7d67
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.
2021-01-19 23:10:09 +01:00
Martin Kleusberg
c951c1cbce Fix filter row losing focus when changing filter values
This was introduced in 6f4990544b.
2021-01-19 22:40:35 +01:00
Carles Pina i Estany
88ca9fa040 Fix issue: save MainWindow geometry, windowState, etc. on exit
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.
2021-01-15 18:35:12 +01:00
Justin Clift
d38c778b5b Merge pull request #2539 from freddii/master
Fixed wrongly spelled words
2021-01-15 04:00:57 +11:00
freddii
e8405b78d7 fixed wrong spelled words 2021-01-14 12:44:44 +01:00
Carles Pina i Estany
ceecb5a117 Add QScrollArea in RemoteDock.ui
Previously RemoteDock was not resizeable too small due to all the
widgets (which have minimum size)

Now with QScrollArea a vertical scroll bar appears if needed allowing
MainWindow too be smaller
2021-01-11 20:32:57 +01:00
Martin Kleusberg
740c88b702 Update to C++14
This updates the qmake and cmake files to enable C++14 support in the
compiler. It also simplifies a function by using a new function
introduced in C++14.
2021-01-11 18:40:11 +01:00
Martin Kleusberg
6f4990544b Fix remaining issue with optimised SELECT statements
This fixes a remaining issue which was introduced in the series of
commits made for improving the performance of running SELECT statements
in the Execute SQL tab. The problem here was that rerunning a query did
not show any results in the view.

See issue #2165.
2021-01-11 18:23:08 +01:00
Himura Kazuto
7495254ca5 Add note for CentOS 8 2021-01-10 14:52:07 +01:00
Martin Kleusberg
99ee8fa1c3 Avoid running SELECT statements twice in Execute SQL tab
This speeds up executing SELECT statements in the Execute SQL tab even
further. Before this the statement was executed twice: once to determine
whether it returns any data and another time to actually get the data.
This is still done after this commit, however the process to determine
whether a statement returns any data is optimised in a way which almost
reduces the runtime of this step to zero.

See issue #2165.
2021-01-09 14:51:58 +01:00
Martin Kleusberg
b41046e6b6 Further speed up loading of data from SQL queries
This further improves the performance of SELECT statements by not
triggering the row count determiniation if it is not needed. So for
queries which return less rows than the configured prefetch block size
we save an extra query. Because this requires querying the data first
and the row count second (before this the order was reversed) the data
also appears faster in the UI.

This commit also fixes another issue which was introduced in commit
89587a7d67: When setting a filter which
made the query not return any data, the column names and the filter row
became invisible. Because of that it was also impossible to change the
filter again.
2021-01-09 14:28:44 +01:00
Martin Kleusberg
cc44c974cd Fix 89587a7d67
This fixes some issues with table browsing which were introduced in
commit 89587a7d67.
2021-01-09 11:49:01 +01:00
Justin Clift
92bc4f34e1 Merge pull request #2532 from mab/patch-1
Update README.md
2021-01-08 22:31:15 +11:00
Matthias Baumgart
af9e98e596 Update README.md
Adapt to new Homebrew api.
2021-01-08 08:28:57 +01:00
mgrojo
fb7248b75d Binary detection: end-of-line characters where not treated as text
Fixes 5e0c56a47f

See issue #1201
2021-01-03 18:02:27 +01:00
mgrojo
576bbe7ef5 Give alternate shorcuts to the ones using F keys
Some keyboards have difficult access to function keys. See issue #2523
2021-01-03 13:30:35 +01:00
mgrojo
be041e5e49 Complete menu accelerators in File and Tools entries 2021-01-02 15:06:16 +01:00
mgrojo
2ebf524c4a Merge branch 'master' of https://github.com/sqlitebrowser/sqlitebrowser
# Conflicts:
#	src/TableBrowser.cpp
2020-12-30 14:54:53 +01:00
mgrojo
a86c196aa3 CSV Export: binary BLOB to base64
CSV is a text file format.

See issue #2521
2020-12-30 13:48:10 +01:00
Martin Kleusberg
89587a7d67 Speed up executing SQL queries
This improves the performance of running SQL queries in the
SqliteTableModel class by avoiding an extra query for figuring out the
column names and data types of the returned data.

See issue #2165.
2020-12-29 21:10:19 +01:00
mgrojo
223a7cd6ab Plot: fix selecting points to select corresponding line in table
This was only working in query results and after the header was clicked,
but not in the general case in the data browser.
2020-12-23 22:01:42 +01:00
mgrojo
df853b30db SQL Execution Editor: appropriate helping message in reload dialog
See issue #1201.
2020-12-20 17:03:26 +01:00
mgrojo
5e0c56a47f Data Browser: avoid showing BLOBs containing unprintable characters as text
See comments in #1201
2020-12-20 16:32:28 +01:00
mgrojo
e0b40ad90e CSV Import: fixes of the local convention option
Added default value for new setting.
Avoid second call to ui->checkLocalConventions->isChecked().

See issue #2140.
2020-12-20 14:58:27 +01:00