94023a5 switched to storing OrderBy terms by column
name and/or expression instead of by column index, and
includes a test to ensure that identifiers are quoted
and raw expressions are not; unfortunately it seems to
have gotten the logic backwards.
The reading of a QTemporaryFile must be done before the object it's destroyed,
otherwise the file is removed.
This was broken since 09aaaccace
Reported in issue #2749.
Working cases tables without rowid and BLOB as primary key:
- Inserted value is actually TEXT, for example, from the text editor in the
GUI.
- Inserted value is really BLOB, for example, from the binary editor or
from SQL and the data is fully binary.
Not yet working case:
- Inserted value is of type BLOB, but the actual data is recognized by
DB Browser as text. In this case, no type affinity is applied by
SQLite and the row is not properly selected.
See issue #2738
Workaround for WindowsVista style (qwindowsvistastyle plugin)
There is some strange bug on windows with the system styles (windows
and windowsvista). When styleproxy is used and QDockWidget has a
custom stylesheet applied to the widget title, close-button and
float-button are rendered huge.
See #2485
DB4SProxyStyle is set before any Widget is created.
QGuiApplication::primaryScreen() is used as a screen.
Now custom QPalette can be set before MainWindows is created,
for example exported palette from KDE (Breeze, Breeze Dark, etc).
Set default maximum icon size for QToolBar to 20px, and for MenuItem to 16px,
before that MenuItem icon was bigger than QToolBar icon.
Pixel metric for SmallIconSize is set to 12px to avoid strange
render behaviour for QDockWidget with custom stylesheet.
This adds support for the RETURNING keyword which was introduced in
SQLite 3.35.0 by adding it to the syntax highlighter and the auto
completion as well as adding it to the lexer and parser (though it is
not used by the latter in any significant way).
Clicking on Edit View in the database structure tab opens a new SQL tab
with a DROP VIEW statement to delete the existing view and a copy of the
CREATE VIEW statement used for the current view. When the user modifies
the CREATE VIEW statement introduces an error in it, and then executes
the statements, the view is deleted and an error reported. Fixing that
error and re-running the script then fails at the DROP VIEW statement.
This means it makes more sense to make it a DROP VIEW IF EXISTS
statement.
See issue #2661.
It does not seem like there is a good reason to always refresh the table
browser dock (there is always exactly one at this point) when opening a
database file, even when it is not visible. This only generates
unnecessary queries to the database.
Remove the F5 shortcut for refreshing the DBHub.io remote databases
because it is ambiguous and can make the main view not work as expected.
Since the refresh action is not super important in the DBHub.io dock any
way it is probably best to just remove the shortcut there.
See issue #2695.
When multiple cells are selected pressing the Delete key tries to set
all of them to an empty string. In case of a unique constraint or
similar constraints this throws an error. This commit copies the
behaviour of the set to NULL menu action in that it aborts at the first
error to avoid multiple error messages.
See issue #2704.
This fixes a possible crash when trying to remove a table constraint
from a table definition. The issue was introduced in commit
4e1d1ff49f.
See issue #2670.
Support of extended selections (non-contiguous cell selections using
Control+Click). The following changes were necessary:
- Copy to clipboard iterates over rows and columns and leaves holes for
non-rectangular selections as empty cells (HTML) or as NULL (SQL).
Fix: Additionally the SQL copy uses NULL when the cell has NULL, not ''.
- Shortcuts for column and row selection take into account non-contiguous
cells and only select those columns/rows.
- The legend in the status line counts correctly non-contiguous rows or
columns.
- Delete Record has been adjusted so only contiguous selected cells are
removed in a single step. Fix: selecting line after removing has been
deleted since the standard behaviour is giving better result.
- ExtendedSelection has been enabled in TableBrowser, it was already
enabled in Execute SQL table-widget.
Possible improvements: pasting from the internal clipboard does not keep
the layout of copied non-rectangular selections.
See issues #1104 and #2638
Since in any case, the empty file has nothing to import and it's admitted by
SQLite as a valid database, it's better to revert to the previous behaviour,
where an empty file dropped or opened by the file manager was treated as a DB
and indeed worked.
The behaviour was changed by cfa4dee3be
See issue #2636
The Clear Filters button is enabled if and only if there is some filter
set for the browsed table.
The Clear Sorting button is enabled if and only if the table is sorted by
some column.
See issue #2616
"Yes" to not be prompted next time for the same table, but yes for different
tables.
"Yes to All" to not be prompted again for any existent tables.
See issue #2633
* Add auto completion for math functions
Math functions are introduced from sqlite 3.35.
Refer https://www.sqlite.org/lang_mathfunc.html
FYI, it need to compile sqlite with -DSQLITE_ENABLE_MATH_FUNCTIONS
* Add auto completion for math function when it had been enabled
Math function can be used when sqlite is equal or higher than 3.35 and
compiled with SQLITE_ENABLE_MATH_FUNCTIONS. When sqlite is compiled with
SQLITE_OMIT_COMPILEOPTION_DIAGS, there is no way to check the compile
options. In this case, we'll check only the sqlite version. Otherwise,
it will check whether sqlite was built with SQLITE_ENABLE_MATH_FUNCTIONS.
This commit replaces the regular expressions for removing end of line
and block comments from SQL queries provided by the user by a hand
written state machine. This makes the code a lot faster, especially for
longer SQL scripts with many statements and many comments in them. It is
also not harder to read than the rather complex regular expressions from
before - possibly even easier to read.
See issue #2619.
In this case too, the corresponding menu entry for exporting the query
results to JSON was missing although it was straight forward to add it
with the same scheme as for CSV.
Renamed the CSV action for consistency.
Related to issue #2607
This check was supposed to help the user understand what this operation was for,
but it was actually preventing to save as view table states that had global
filter, display formats or custom order and not column filters. It's better to
give the user the freedom, even to create maybe useless vies as:
`CREATE VIEW "example_view" AS SELECT * FROM "main"."example"`
See issue #2615
This fixes a bug introduced in 73efa11680.
Because SQLite reports ALTER TABLE statements to return one column worth
of data, DB4S assumed they are close to a SELECT statement and therefore
did not fully execute them.
See issues #2563 and #2622.
The corresponding menu entry for exporting the query results to JSON was missing
although it was straight forward to add it with the same scheme as for CSV.
Related to issue #2607