Commit Graph

3511 Commits

Author SHA1 Message Date
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
mgrojo dafa873dea CSV Import: fix importing into existing table
The previous commit broke the application of the type affinity rules for
already existing tables. Now the problem is at least restricted to
the case when the new "Use local number conventions" is used.

See issue #2140.
2020-12-20 00:58:14 +01:00
mgrojo f9314b6dbe CSV Import: give option to use system locale conventions
This will allow to import numbers in CSV which use ',' as decimal separator
and '.' as thousands separator, when the system locale is Spanish (Spain),
for example.

Additionally this commit detects the full range supported by SQLite for
INTEGER and REAL numbers, that is, 64 bit integers are not converted to
REAL and double precision reals are not converted to TEXT.

See issues #1347 and #2140.
2020-12-20 00:20:22 +01:00
mgrojo 4a2179baad Spanish translation: errors in translation of functions and iif translated 2020-12-18 21:53:56 +01:00
mgrojo e5734d4fd1 Export SQL: fix quoting of BLOB values and non-printable strings
This ensures that the export is accurate and consistent, and that the data
can be duplicated without any loss.

See issue #1201#issuecomment-742570014
2020-12-12 19:59:59 +01:00
Martin Kleusberg 11058633eb Allow opening recent files in read-only mode using a different shortcut
This adds a shortcut for opening recent files in read-only mode when
they were opened in read-write mode before and vice versa by pressing
Ctrl + Shift + %n instead of Ctrl + %n.

It also allows you to hold the Shift key while clicking a recent file
menu item to achieve the same effect.

See issue #2484.
2020-12-11 14:41:35 +01:00
Martin Kleusberg 9356d00939 Enable URI filenames in SQLite
Enable usage of URI filenames in SQLite calls. In theory, this should
not break any current use case as we tend to pass full paths to SQLite
and they should never start with "file:" or similar.

This should make it possible to attach databases using full URI
specifiers.

See issue #2493.
2020-12-11 14:13:03 +01:00
mgrojo 2742dcfa89 New follow mode for the SQL editor
Answering "Yes to all" will follow any further external file change until
the file is internally edited.

See issue #1839
2020-12-07 21:39:55 +01:00
mgrojo 2bd82cb4db Improvements in the file system watcher
- Add "No To All" option for ignoring all future modifications
- Do not watch the file while the dialog is still open

See issue #1839
2020-12-07 20:59:53 +01:00
mgrojo 629c7ff677 Message for trying to reduce the number of invalid issues 2020-12-06 22:03:08 +01:00
Justin Clift 11ba9d397c Update to Qt 5.15.2 for our macOS builds 2020-12-07 07:58:57 +11:00
mgrojo 1e4a88dd0a Warn user to apply or discard unsaved changes in cell editor
Additionally disable the entire widget when not associated to any valid
index.

See issue #2488
2020-12-06 20:17:06 +01:00
mgrojo af84e89b1f Add Ctrl+Enter as shortcut for executing query
See issue #2502
2020-12-06 20:12:17 +01:00
mgrojo 8b98df145a Avoid type conversion warnings in Plot Dock 2020-12-06 20:01:09 +01:00
mgrojo 7d04102092 Allow selecting fixed format for big integer numbers
The default format changes to scientific format when the width of the
number would be longer. The user will be able to select fixed format for
integer numbers in the contextual menu. Note that precision is set to 0,
because in the fixed format trailing zeros are not omitted.

See issue #2498
2020-12-05 17:21:33 +01:00
Martin Kleusberg efb9f9c9e0 Add new menu item to show the row counts of all tables
This adds a new action to the Tools menu which creates a new SQL tab
with a statement to count the number of rows of all tables and views.

See issue #2464.
2020-12-04 11:15:08 +01:00
YFdyh000 4a4757575d Update Chinese (Simplified) translations 2020-11-30 16:40:28 +01:00
mgrojo 2390b9e662 Store a relative filename if the path to project and to DB is the same
See issue #1478
2020-11-27 17:44:35 +01:00
mgrojo 9a70af7973 Evaluation mode in the Edit Database Cell editor
Entered expressions are evaluated using SQLite and the result is saved in
the cell.

The SQL Evaluation mode reuses the class used for the "Execute SQL" editor
so syntax highlighting and call-tips are supported.

See issue #2387
2020-11-27 17:44:35 +01:00