* Upgraded snap builds to use core20
* using core20 (Ubuntu 20.xx) for builds
* added required dependencies
* Badges for Snap builds and Updated Ubuntu section
* Added badges for Snap Builds
* Updated Ubuntu Section to give info about packages on old Ubuntu versions
* Fixed typo and verbiage in Readme
Update line number width when zooming. Calculating number width using `font()` does not take zoom into account. So, the overload of `setMarginWidth` with `QString` as second parameter was used. This way we leave the width calculation to QScintilla which considers the zoom while calculating.
This slightly changes the window layout of the main window and its
docks by a) removing or reducing the margins around some widgets and b)
changing the style of some widgets to flat i.e. removing borders around
them. Via these changes we save a little screen space which should
especially help on smaller screens and hopefully also make the window
layout easier to read by not having as many parallel border lines in
some docks.
When a project file is loaded, changes are made, and the event close is
triggered, we lose the SQL file contents, because the project file is saved
when the tabs are close. Now the order is reversed, so the project saving
catches the correct state.
See issue #3007
If we follow the steps described in
https://github.com/sqlitebrowser/sqlitebrowser/issues/2910#issuecomment-1186259390
we get this warning:
"Database didn't close correctly, probably still busy"
The error has not been prevented, but by using sqlite3_close_v2 instead
of sqlite3_close, we can assure that the connection is eventually released.
There are project files with settings saved for a table with empty schema
and name.
We let the user load a new DB file when the one referenced by the project
is not found, opening the door to load a DB with a different structure.
A final case for this inconsistencies can be that we let the user cancel
the opening dialog, and the project can be opened without a DB file.
See issue #3007
This commit refactors the handling of constraints and continues the work
started in 43107ea773. Instead of heavily
relying on runtime polymorphism with these changes we move towards more
compile-time polymorphism. Noticeable the constraint data types do not
have a type function any longer; instead they are differentiated by
their actual data type.
This has several benefits:
- More likely to catch errors at compile-time and therefore avoid them
at runtime.
- The program runs faster. This should be most noticeable for databases
with a very large amount of tables or other database objects.
- The code should be easier to read and maintain.
Additionally this should also prepare for even more refactoring in the
future.
After moving both foreign keys and check constraints to different tabs
in the Edit Table dialog, the previous constraints tab now only shows
primary keys and unique constraints. To accomodate for this reduced
feature set, this commit renames their internal names and uses a
narrower data type for handling the constraints.
Just like before in 53b5493f2e which added
an extra tab for foreign keys, this adds an extra tab for editing check
constraints in the Edit Table dialog. Again, this makes the UI easier to
navigate and adds support for editing of check constraints to the
dialog.
In the Edit Table dialog we had two separate tabs, one for table fields
and one for table constraints. The table constraints tab showed primary
keys, unique constraint, foreign keys, and some check constraints and at
least to some extent allows editing them.
This commit moves the foreign keys to a new third tab. Even though this
adds extra UI elements I feel like this might simplify finding and
editing exactly the items you are looking for and leads to a clearer UI.
This also adds support for fully editing foreign keys in the new tab.
Previously the references table and columns could not be edited in the
constraints tab. The only feature these changes remove is converting
other constraints to or from foreign keys which again simplifies the UI
and makes it less error-prone because this is not really a meaningful
thing to do.
SQLite 3.39.0 introduced expressions of these forms:
expr IS DISTINCT FROM expr
expr IS NOT DISTINCT FROM expr
Since these can be used in indexes and check expression, we need need to
add support for these expressions to the SQL parser.
- Do not hide the title bar if the dock is floating when the second one is
closed.
- Fix the number of docs for hiding the title bar when it is opened.
Related to issue #2283.
This saves space and avoids redundancy in the different places where the
table name appears.
A new toolbar button for adding a new dock is included, so the
functionality is still visible (it might be more discoverable now, indeed).
Related to issue #2283.
See comment in:
https://github.com/sqlitebrowser/sqlitebrowser/issues/2918#issuecomment-1003108299
New check option in the contextual menu of the DB schema dock to allow
drag & drop of SELECT queries, provided that only a table or fields of
the same table are dragged from the DB Schema tree.
If there is no SQL tab in the project (cannot reproduce that any longer,
only after manual editing of the project file), the first query and
selection of a column index greater than the number of columns in the
default table browsed in the Data Browser will cause a crash, because
m_currentTabTableModel will still be associated to the table in the
Data Browser main tab.
Remaining detected case for a potential data loss in the cell editor have
been fixed:
- Switching to another main tab.
- Start a filter.
In both cases a dialog for saving or discarding is open.
Additionally, the cell editor shows the cell coordinates currently open.
And the NULL text in margin is reset when the user types in the editor.
See issue #2488