The following changes set the project as modified in order to ask to save
changes in project file when closing DB or application:
The main database file and any attached database file.
* PRAGMA values
* Show Row Id option
* Encoding
* Unlock View Primary Key option
* Sort columns and sort directions
* Column widths
* Applied Filters
* Display Formats
* Hidden columns
See issue #1706
When the Ctrl+F was used in the Scintilla widgets of the SQL Log or Edit
Database Cell docks, the shortcut was ambiguous with the search find bar
action, which had window context. Now the later has widget context and a
new widget-context shortcut is explicitly connected to the action in the
editors of each new SQL tab.
See issue #1746
A new find dialog, bound to Ctrl+F, has been added to all the Scintilla
editors. The dialog is basically the Find/Replace dialog, whose replace
related controls have been set to invisible.
This shortcut and the new menu contextual entry are disabled for the
Execute SQL editors, since there the shortcut is already assigned to the
search bar and it would also be redundant.
See issue #1746
This adds a very basic implementation to watch for external
modifications in SQL files. Whenever another application modified a SQL
file which was opened from or saved to disk, a message box pops up to
notify the user of the changes.
See issue #1839.
Move the code for opening and saving SQL files in the Execute SQL tab
from the main window to the SqlExecutionAtra class.
Also fix some warnings in the code for opening new SQL tabs.
In the Table class we need to store whether this is a WITHOUT ROWID
table or now. Instead of just storing a boolean flag for that we were
storing a list of the rowid column(s). This is not just more complicated
to handle than a simple flag but also more error-prone because the list
must always be kept equal to the list of primary key columns. Failing to
keep them equal would result in an invalid SQL statement.
Now number of rows and columns is always showed, independent of the number
of cells threshold. Plural forms are used in translations (Spanish and
British English updated for testing).
Min and Max have also been added to the status bar message.
When a selection is made in the Data Browser, the status bar shows:
number of rows, number of columns, sum and average of numeric values (other
data types count as 0) in the selection.
For avoiding expensive computations when the selection is very big
(selecting all cells or an entire column) the threshold setting for the
completion is reused.
This was inspired by #1791, but does not implement the proposed feature.
For multi-column PKs in WITHOUT ROWID tables the first implementation
added a dependency on the JSON extension by using the json_array
function. To make sure DB4S works even without this extension, this
commit adds and makes use of a custom extension function which
essentially does the same thing as json_array.
This add initial and mostly untested support for WITHOUT ROWID tables
with multiple primary key columns. It should now be possible to update
and to delete records in these tables.
This commit also improves the overall handling of multiple primary key
columns in preparation for better support of them in general.
Note that this makes us depend on an SQLite version with a built-in JSON
extension.
See issues #516, #1075, and #1834.
* Allow base64 encoding of blobs
* Fix typo error on base64 encoding resulting in unterminated string being returned.
* Limit padding characters to maximum of two
* Tidy up padding characters
* Add detection of UTF8 format when decoding base64
This adds visual sort indicators to the already working multi-column
sorting. Qt sort indicator is disabled, so only one indicator per column
is visible.
Unicode characters are used to indicate direction (triangles) and sort
column order (superscript numbers).
See issue #1761
When attaching an SQLCipher encrypted database we need to set the page
size, KDF iterations, and HMAC and KDF algorithms. This needs to be done
before actually attaching the database but we tried to do it afterwards
which silently fails until the first statement is executed on the
attached database. This commit modifies the "default" values for these
pragmas in order to make sure SQLCipher uses the correct values right at
the beginning.
See issue #1799.
When opening a plain database and trying to attach an unencrypted
database we need to explicitly specify that there is no key for the
attached database. Otherwise SQLCipher is going to use the same key as
for the main database which results in an error.
See issue #1814.
A new dialog for editing conditional formats that can be invoked from the
filter line editor or from the data browser contextual menus. The dialog
allows adding and removing conditional formats, changing the priority order
and editing foreground colour, background colour and filter condition.
The conditional formats have been expanded to allow defining the foreground
colour. By default is the setting configured by user.
This is a continuation of the functionality introduced in PR #1503.
A new option, in the toolbar of the Edit Database Cell, is added for
setting word wrapping for the text editor modes. It is now independent of
the SQL preference. The configuration reading the editor/wrap_lines setting
is moved to the particular SQL editor class.
Added icon from the Silk icon set.
See issue #1796
Some SQLite keywords were not highlighted and QScintilla included a lot
of words that were not keywords for SQLite. This redefines the keyword
list for highlighting to match the list that we already prepare for
completion.
The list has been updated with some missing cases from the current SQLite
keyword list: https://www.sqlite.org/lang_keywords.html
QScintilla seems to reset many settings when setLexer is called, so we
need to restore the font when switching from the lexer modes to the mode
without lexer (plain text).
See issue #1793.
Added new argument to command line for saving a value for a setting and
not only running it temporarily: -O/--save-option
Fix string lists settings so they are saved as an actual QStringList and
not a string. This assumes these settings are always named "*list".
Currently they, and only they, are.
Together with --quit, this argument allows saving the extensions/list and
other settings after an installation depending on options selected by user
in the installer. For example, running (Linux syntax):
./sqlitebrowser --save-option extensions/list=/path/to/libsqlitefunctions.so,/path/to/libsqlite-formats.so --quit
will save the two extensions to the preferences and they will be
automatically loaded every time DB4S is loaded.
See issue #1224 and PR #1716.
This is so the new JSON library we're using doesn't break things. :)
Note also the "8.1" added to the end of the vcvars line in the batch
file, so the correct SDK is selected.
Without it, when both MSVC 2015 & MSVC 2017 are installed, the MSVC
2015 installation (by default) will be unable to find rc.exe.
Use the QScintilla widget for all the text modes of the Edit Database Cell
dock. All the features are believed to be preserved.
- The plain text mode is materialised removing the lexer.
- Null values are indicated now in the margin instead of using a
placeholder. The same pattern is also used for the Image and BLOB data
cases when the editor is switched to a text mode. In the dark mode, the
line number margin matches now the style-sheet and instead of the
configurable editor colours.
- Read-only state in the editor is hinted by the caret not blinking, but
the text is still selectable by keyboard or mouse.
Features and fixes added by using this widget:
- Find/Replace dialog for the plain text editor. See issue #1746
- The QScintilla widget does not strip CR characters. See issue #1793
- Line numbers and visible caret line in the text mode.
Replace Qt's own JSON library functions by Niels Lohmann's JSON library
in the Export JSON dialog. This was necessary because for very large
JSON objects Qt's library functions generated incomplete JSON exports.
See issue #1789.