When renaming a column using SQLite >= 3.25 and changing something else
in the table, you would lose all the data in the renamed column. This is
because the second part of the alterTable() function (the part after the
renaming) didn't know about the new column name and so assumed it still
to be the old one.
See issue #1650.
There are three reasons for not hard-coding the shortcut names in tool-tips
or other texts inside the UI elements:
- Qt uses portable names for the shortcuts, that are translated to different
key combinations depending on the operating system, e.g. Ctrl is translated
to Cmd in MacOS.
- An eventual change in a shortcut is propagated to user strings affecting
translations.
- If we ever allow configuring the shortcuts in Preferences, the text
would be incoherent.
The shortcuts are added programmatically to the tool-tips and consequently
they are removed from the UI files. The translation files have been updated
semi-automatically so the translated strings aren't lost.
Shortcuts have been added to actions that lacked them (because they are
implemented through other means) so they can be used. The WidgetShortcut
scope prevents in those cases any interference with the current shortcut
logic.
In the case of Ctrl+Return for "Execute all/selected SQL", it has been
moved from code to UI file, since it no longer made sense.
See issue #721
This translation was working for Ubuntu 16.04, because it matched the
official Qt translation for Shift, but in Qt5.9.5 (Ubuntu 18.04) the
translation is no longer abbreviated (Mayúsculas) and the former
translation breaks the shortcuts. Using the original English terms should
work for all versions and it is automatically translated in the display.
This shows a short text in the Remote dock when no certificates are
configured yet. This text contains links to the dbhub.io page and gives
at least some information on the overall process. As soon as the first
certificate is imported, the old view is shown instead.
This fixes a bug in the code to modify multiple table columns in one go.
We were accidentally adding more tracked columns when adding a new
column and then changing its name.
See issue #1627.
The POSIX flag is passed to QScintilla for stardardisation of the regex
implementation. This only changes the syntax for sub-expressions. Before
this change it was '\( \)'. With the POSIX flag it is simply '( )' for
sub-expressions, consequently \( and \( have to be used for matching
parenthesis.
Both the Qt implementation (used in filters and REGEXP operator) and the
C++11 standard (possibly used in the future for the editor, if QScintilla
add support) use the the new syntax for sub-expressions.
References:
https://en.cppreference.com/w/cpp/regex/syntax_option_type
> If no grammar is chosen, ECMAScript is assumed to be selected.
https://en.cppreference.com/w/cpp/regex/ecmascript
> The Atom ( Disjunction ) is marked subexpression
Qt also uses subexpressions in the POSIX style.
http://doc.qt.io/qt-5/qregexp.html#capturing-parentheses
See issue #1625
New check box in the Find and Replace dialog for Scintilla editors. The
new option uses the feature in QScintilla for finding text in the
selection only.
The implementation has been changed to use findFirst(InSelection) and
findNext so it works exactly as designed by QScintilla. Consequently the
finding process has to be cancel whenever any of the parameters have
changed.
The last line of the selection is considered part of the block, even if it
is not completely selected. At the same time, we have to discard this last
line of the selection, if the index is 0, since in that case there is no
actual selected character in the line.
Additionally all the steps in the replacement are considered a single
action for history, so that user can undo the change in a single undo
action.
See issue #1614
QScintilla is returning strings with text(line) with line terminator and
they are also counted by lineLength, so the Windows version has to
substract one for setSelection.
This solves various problems resulting in characters being removed at the
beginning of lines when commenting or uncommenting blocks of code with
Windows line terminators.
A new command is added for commenting or uncommenting SQL code (depending
of the state of the first line of the block).
It is bound to "Ctrl+/" as used by many IDEs ("Ctrl+-" is more standard as
Zoom out). Unusual Scintilla binding for "Ctrl+/" is removed for avoiding
interference.
If there is no selection, the current line is un/commented.
See issue #1614
Each time the searched term or the dialog is closed, the find process in
the QScintilla widget is cancelled. This avoids the problem mentioned in
issue #1612 and similar others, like finding, then changing the searched
term and pressing Replace. In all these cases Replace only finds the next
term to be replaced without performing any actual replacement.
This commit fixes the SQL export which did not quote the field names in
the INSERT statements.
This also simplifies the code for escaping SQL identifiers.
In the Edit Table dialog we used to call our alterTable function (which
works around SQLite's missing full ALTER TABLE support by - besided
other things - copying all the data of the table) for pretty much every
change immediately. This was taking a lot of time for larger tables.
Our alterTable function allowed any number of changes if they affect
only one field of the table at once. So we could have reduced the number
of calls a lot by just using that capability. Instead however, this
commit improves the alterTable function to make possible transforming a
table completely in just one call. It does so by taking the new table
schema and using that without further modification. It also takes a new
parameter to keep track of what column in the old table becomes what
column in the new table, so the data can be preserved.
This commit obviously also changes the Edit Table dialog to make proper
use of the new features. This means that whatever changes you make to a
table, you will only have to wait once until for the alterTable call,
and that's when clicking the OK button.
See issue #1444.
waitForDbRelease receives a parameter for waiting, cancelling the other
operation or asking the user; defaulting to ask.
The wait option is used for the conditional formatting, so it doesn't
interfere with the loading. This avoid opening a dialog when scrolling
the table over a still not fetched area with conditional formats.
And it is done independently of the threading model supported by SQLite.
This adds support for the REGEXP operator using the syntax /regexp/ in the
filter line boxes.
A new helper option for a not-containing filter is added using this new
syntax. This could be simplified using a NOT LIKE filter, but we don't
currently support that.
The "Use in Filter Expression > Containing" option escapes a possible
slash in the beginning, so it is not interpreted as a regexp filter.
See issue #1522
This slightly changes the behaviour regarding the read-only mode in
project files. It makes sure that we always respect the user's choice to
open a file in read-only mode, even if the project file says it wasn't
opened in read-only mode before.
When opening a database in read-only mode and creating a project file,
save the read-only flag in the project file.
When loading a project file with a read only flag set, open the database
in read-only mode.
See issue #1598.
This adds a label to the status bar which becomes visible whenever the
database is busy. It also specifies the currently running action. Also
add a button which allows you to cancel this action at the next
opportunity.
Note that this doesn't work for the Execute SQL tab yet which requires
some more rewriting of the code there.
When a conditional format is used and the table does not load all the rows
at once, a deadlock ocurred when scrolling to a not yet loaded area.
This avoids the deadlock by unlocking before the conditional format query
is performed.
Additionally the cancel-query dialog is avoided when the threading mode of
SQLite is Serialize, since in that case the queries can be sent to SQLite
concurrently.
See discussion in PR #1503
If we execute a select statement and there is some trailing whitespace or
comments in the buffer, we are passing that to SQLite and fooling
ourselves thinking that it may be a query modifying the database. Since
we aren't very smart about knowing which queries modify the database, this
change at least avoids this particular case by breaking when there is only
trailing whitespace and comments.
The issue has probably origin in #1455, since previously we didn't pass
the comments to SQLite.