Two new options editable from a new context menu of the dock:
- Drag & Drop Qualified Names: add table name to fields and schema name
to other objects (except for "main" schema)
- Drag & Drop Enquoted Names: whether to surround the identifiers by the
configured quoting characters for identifiers.
Support for dragging & dropping of attached databases names.
Add "." as separator for multiple dropped objects other than fields (since
they are not usually used in SQL as a list). This allows to compose
qualified names by dropping the parent and the child items together. This
is only generally useful when the "Qualified Names" option is disabled.
See related issue #1433
The quotes around identifiers was hindering the automatic proposal of
fields when the table is completed or of tables when the schema name is
completed. By adding the dot surrounded by quotes (parent's end-quote and child's
begin-quote) as word separator, the child completion menu is activated
when the user presses the child's begin-quote.
See related issue #1433
Ctrl+' is used by spreadsheets for copying formula/value from the cell
above.
Our shortcut copies the value inside the inline editor when it is text.
That mimics the behaviour of LibreOffice Calc. For binary data that cannot
be edited inline, the BLOB is just copied from the above cell to the
current one.
See discussion in PR #1516.
The temp_store, wal_autocheckpoint and synchronous PRAGMAs are only
stored for the current database connection but not saved in the database
file. So to fully restore the working environment after closing a
database, this commit adds these three PRAGMAs to the project file
format.
See issue #1518.
Changing the auto_vacuum PRAGMA requires us to run VACUUM most of the
time. So to be safe we just do that for every change to the PRAGMA now.
See issue #1518.
After editing a table we perform a foreign key check to see if the
modifications caused any problems. This check doesn't seem to work
because it expected that in case of a problem the PRAGMA would fail.
This however isn't the case - it just doesn't return any results but it
doesn't fail. This commit fixes the check and only shows rolls back if
the PRAGMA returned any data.
When importing an SQL file, defer foreign keys until the import is
finished. This is necessary if there are foreign key constraints in the
imported table and the order of the INSERT statements doesn't match the
hierarchy of the constraints.
Also perform an integrity check at the end of the import.
See issue #1519.
This commit fixed wrong error messages in the code we use whenever
multiple SQL statements are executed at once programmatically, most
noticeably in the SQL import. In the case of an error we would first
clean up and rollback and only then recover the error message which
usually would be lost by then. With the changes in this commit the first
thing we do is to recover the error message and only then clean up.
See issue #1519.
If the deletion of a record is rejected by the SQLite3, for example, due to
the presence of Foreign Key constraints, the corresponding rows must not
be deleted from the model.
* Issue #530: constraints on table prevents new record being added
This adds a new dialog for adding records to a table. The current approach
is broken for several cases where foreign keys and check constraints are
impeding the insertion of an empty record. With the dialog, the user can
inspect the constraints (tooltip) and type of fields and add values
consistent with the requirements. The data is only inserted when the user
presses the Save button.
The dialog is modelled after the Edit Table or Edit Index dialog. An upper
frame allows entering the data using widgets. The lower frame previews the
SQL statement that will be used.
The old approach for adding records is still accessible pressing Tab on
the last cell of the table.
* Fix build problem introduced in previous commit on this branch
* Dialog as fallback for failure after empty row insertion and read only text
The insertion of an empty row is always tried. When it fails due to
constraints and foreign keys, the Add Record Dialog is open so the user
can enter values for the new record considering the constraints.
When the table has not constraints, or the row insertion provides valid
values, the user is still able to insert rows using the simple approach.
SQL preview in dialog is now read-only.
* Visual improvements for the Add Record dialog
QLineEdit as item delegate for the value, so it is more visible that we
are supposed to edit the value.
Remove last end-of-line in tool-tip.
* Improvements in the "Add Record" dialog
Display of NULL values using DisplayRole (no focus) or place holder text
(when focus).
Set value to NULL through a context menu and shortcut in the value line
edit.
Take text type affinity into account for quoting or not entered numbers.
New isType and affinity functions in sqlitetypes.
Clarify wording of constraints in tooltip for value. Added the same tooltip
for the type.
Escape quotes inside string values.
Removed unused parameters warnings.
Other wording or code improvements based on the pull-request review: #1477.
* User access to the Add Record dialog
The Add Record dialog is now accessible for the user. The New Record button
is converted to a QToolButton and a new pop-up menu is added to it for
invoking the in-line table insertion (New Record) or the Add Record dialog
(Insert Values...). What's This information for the button updated.
The plot and all plot settings disappear when you click the Refresh
button in the Browse Data tab. This problem was introduced in the
multithreading patch.
Since PR #1436 we allow configuration of the identifier quotes instead
of always using backticks. But in the code for detecting a custom
display format on a column the assumption still was that normal columns
without a custom display format are always surrounded in backticks. The
result of this was that even if there is only a single display format
configured for a table, no field of no column can be edited anymore.
This commit restores the original state which would only disable editing
for the columns with a custom display format.
This is required for Qt version < 5.10. For Qt versions >= 5.10 the
unhiding of all columns before rehiding the desired ones does nothing
because there the table view doesn't store its state anymore. And when
it does nothing we don't change the state of our view settings which in
turn triggers the mentioned problem.
See issue #1475.
* Added CD (Continuous Deployment) snap packaging support
* Added required files to create a snap package. Launchpad account will automate the build whenever code is committed to git repo
# What is a snap?
A snap :
* is a squashFS filesystem containing your app code and a snap.yaml file containing specific metadata. It has a read-only file-system and, once installed, a writable area.
* is self-contained. It bundles most of the libraries and run-times it needs and can be updated and reverted without affecting the rest of the system.
* is confined from the OS and other apps through security mechanisms, but can exchange content and functions with other snaps according to fine-grained policies controlled by the user and the OS defaults.
# Notes on improvements squashed into this PR
* Reduced the snap size by removing files from prime stage.
* Fixed typo in snap summary, thanks @justinclift for pointing out
* Reduced the size of snap package by removing big files from the package
* Added revno to the version script
* Added long description of snap package from deb package
* Borrowed some code from vlc snap script to fix fall back UI (need further research to fix issue)
* Added echo message to request users to report issues with snap package
Signed-off-by: Navdeep Singh Sidhu <deepsidhu1313@users.noreply.github.com>
SQLCipher reports in its SQLITE_VERSION macro the version of the
underlying SQLite version. Because we cannot easily get any other
version from SQLCipher and because the reported version is not identical
to the SQLCipher version we need to rephrase the wording in the dialog a
bit to keep the two versions separated.
See issue #1474.
When exporting a database to an SQL file we need to query the row count
of each table to calculate the progress later in the actual export. This
commit replaces the SqliteTableModel class which was used for this
purpose by a simple query function. This might be slightly faster here
but more importantly avoids a progress window being shown for each table
before finally seeing the one for the actual export.
See issue #1476.
We have already fixed the rowid column from appearing after almost every
action in the Browse Data tab, for example in commit
39302f5b60.
This didn't fix every issue related to this problem though. Hidden
columns are shown too and modified column widths are reset. Also this
happens for different actions, for example the column widths are also
reset when sorting the view or when changing the filters. All these
problems are hopefully fixed by this commit.
See issue #1475.
Change the control of the page_size PRAGMA from a spin box to a combo
box in the Edit Pragma tab. This makes sure no values are entered which
aren't a power of two. The same change was done in the Cipher dialog a
while ago for the same reasons.
When loading a project file which changes the foreign_keys or the
case_sensitive_like PRAGMAs while being in the Edit Pragma tab didn't
update the UI accordingly. Only after changing the tab and returning to
the Edit Pragma tab updated the controls.
We allow the user to edit the case_senstive_like PRAGMA via the UI. But
because its state is not saved in the database - just like with the
foreign_key PRAGMA - we should save it in the project file for users who
want to restore the entire environment.
* Allow "getting" and setting case_sensitive_like pragma
In order to allow case insensitive filtering, the pragma
case_sensitive_like is added to the GUI. Given that this pragma cannot be
read, a special SELECT request is made in DBBrowserDB::getPragma for
inferring its value.
See issue #1489.
* Warning in the pragma case_sensitive_like
This pragma has some peculiarities, so it is convenient to warn the user
about it through a tool-tip in the value.
Our procedure for editing tables may involve a drop of the old table
definition. This will trigger the "ON DELETE CASCADE" clauses of the
child tables, leading to unexpected and silent data loss.
Following the procedure described in:
https://www.sqlite.org/lang_altertable.html
we can guarantee that no data is deleted, but at the cost of opening a
new transaction specific for the table modification. The possible pending
changes must be saved before. This is only done when the foreign_keys
pragma is enabled.
See issue #1481
Menu actions that take the user to a dialog, where the action is completed
with some interaction and that could be cancelled, now have ellipsis.
Actions that only open an informative window do no longer have ellipsis.
Title case used in all menu entries.
See issue #1434
- Some actions not directly related to file operations over databases or
projects have been moved from "File" to a new "Tools" top-level menu entry.
Future tools can be added here.
- Preferences moved from "View" to "Edit" (MacOS is supposed to still have
it in the application menu).
See issue #1434
This disables translation for PRAGMA names and values in the Edit Pragma
tab. The values must not be translated when using the current
implementation because they are used as shown for reading and writing
the PRAGMA values. The names could be translated but probably should not
be because they are more fixed name than description of their function.
See issue #1489.
The translation of key sequences must be empty or follow the official Qt
translated names, otherwise the key sequence is not recognised and it will
not work.
The official translation for Shift key is "May" (not "Mayús" or "Mayús.")
See possibly related issue #1491
Add a new menu option for opening an in-memory database. When working on
an in-memory database some menu options are disabled because they only
make sense when the database is also written to disk. I have left the
Write Changes button enabled though because for some actions the current
transaction needs to be committed - even though it's only committed to
memory then.
See issues #335 and #1492.
The application crashed for me when I opeend a database, then switched
to Browse Data tab, added some records there, then created a new empty
database.