Commit Graph

2925 Commits

Author SHA1 Message Date
Martin Kleusberg
64a596a887 Use even less Qt containers 2019-05-06 18:50:05 +02:00
Martin Kleusberg
37aaa4c7f2 Avoid using std::regex for now
It turned out that on some platforms we still aim to support the stdlib
had not yet implemented std::regex. For this reason we want to avoid
using it for now.

In the particular use cases here it was also not the best solution. It
was faster to write using a regular expression instead of a hand coded
loop but clearly a simple loop should be more efficient here.

See issue #1873.
2019-05-05 15:35:50 +02:00
Martin Kleusberg
d87f253940 Attempt to fix build error on some platforms
See issue #1873.
2019-05-03 17:59:11 +02:00
Martin Kleusberg
16768d5474 dbhub: Respect the order of the licence list and remove "Unspecified"
Respect the suggested order of the licences as provided by the dbhub.io
server instead of sorting them alphabetically by their internal key.

Also remove the hard-coded "Unspecified" licence option because the
dbhub.io server provided its own "No licence specified" option.
2019-05-03 15:28:02 +02:00
Martin Kleusberg
5e90d90ac6 Replace all typedefs by usings
This is just a matter of code style, no functional change whatsoever.
2019-05-03 15:06:48 +02:00
Martin Kleusberg
40aff11086 Use even less Qt containers 2019-05-03 15:04:15 +02:00
Martin Kleusberg
b70e25c786 dbhub: Add a built-in certificate for read-only access to dbhub.io
This adds a built-in, default certificate which enables read-only access
to dbhub.io. This should make it easier to try out the remote features.
When trying to open the Push Database dialog, a message with more
details and all required links is displayed.
2019-05-03 13:27:07 +02:00
Martin Kleusberg
d344f396b2 Use Niels Lohmann's JSON library everywhere
We started to use Niels Lohmann's JSON library instead of the one
included in Qt for the Export JSON dialog a while ago because Qt's
implementation showed some problems. To avoid any similar issues and
because Niels' library has a much nicer API, this commit migrates all
our code to his library.
2019-05-02 20:09:24 +02:00
Martin Kleusberg
b803e3c49f Use more STL containers instead of Qt containers 2019-05-02 17:02:59 +02:00
Justin Clift
a0624b0f8f Merge pull request #1869 from demian2g/patch-1
Update sqlb_ru.ts
2019-05-02 22:47:33 +10:00
demian2g
faaa282614 Update sqlb_ru.ts
typo fix
2019-05-02 15:37:55 +03:00
Martin Kleusberg
29ca549f2f Fix updating records after changing the primary key
In the Browse Data tab updating a row after having updated its primary
key or part of it before was broken for multi-column primary keys. When
updating the value of a primary key column and then updating any part of
the row afterwards, we were still using the old value until the view was
refreshed. With this commit it is possible to immediately update the
row using the updated primary key values.

See issue #1834.
2019-05-02 14:18:16 +02:00
Martin Kleusberg
9c0b36d7b7 Speed up the loading of row data a bit
This improves the performance for loading row data with my setup by
about 10%. Incidentally, the conversion from Qt to STL containers
reduced the performance by about the same number.
2019-05-02 12:34:14 +02:00
Martin Kleusberg
e16537dd9a Use emplace_back some more 2019-05-02 12:05:27 +02:00
Martin Kleusberg
59e1edc2ba Add a primitive benchmark tool for measuring the time to fetch all rows
This adds another primitive benchmark tool which in this case helps
measuring the time required to load all remaining rows from the selected
table. When activated using the LOAD_DATA_BENCHMARK define, it opens a
message box after loading of all rows using the fetch-all-data button in
the Plot Dock is clicked.
2019-05-02 11:47:35 +02:00
Scott Furry
925eed3ef8 During GCC build, series of warning messages regarding shadowed variables were
produced. Messages would take the form:

[SQLB root]/src/sql/sqlitetypes.cpp:465:79: warning: declaration of ‘fields’ shadows a member of ‘sqlb::Table’ [-Wshadow]

and reference

[SQLB root]/src/sql/sqlitetypes.h:310:17: note: shadowed declaration is here
     FieldVector fields;

All incidents isolated to [SQLDB root]/src/sql/sqlitetypes.{h,cpp}.
Change renames local variables to silence warnings.

no errors after execution w/ gcc/clang builds on Linux.
2019-05-01 22:13:55 +02:00
Martin Kleusberg
a88fad2145 Do not print an error message when a PRAGMA did not return any value
When a PRAGMA query did not return any value (most notably the PRAGMA
foreign_key_check after editing a table using the Edit Table dialog), we
used to print an error message to the console. There were no further
side effects but the message could be irritating. This extra error
message is removed by this commit.

See issue #1868.
2019-05-01 22:10:06 +02:00
Martin Kleusberg
a1b43bca73 Use std::tolower with unsigned char only 2019-05-01 12:15:04 +02:00
Martin Kleusberg
14f91e95db Add missing include 2019-05-01 12:12:40 +02:00
Martin Kleusberg
20eb5e078e Fix a warning 2019-05-01 12:10:34 +02:00
Martin Kleusberg
0acbcce80c Fix compilation for older versions of Qt
QRandomGenerator was introduced in Qt 5.10 only.
2019-04-29 21:39:44 +02:00
Martin Kleusberg
189652d350 Remove some unnecessary includes 2019-04-29 20:54:26 +02:00
Martin Kleusberg
f821fbb1a8 Silence a couple of warnings 2019-04-29 19:14:10 +02:00
Martin Kleusberg
15c23bb0d3 Use some more SQL containers instead of their Qt equivalents 2019-04-29 18:11:19 +02:00
Martin Kleusberg
f59a2453a2 Fix some warning and other code style changes 2019-04-26 14:48:24 +02:00
Martin Kleusberg
ad60a019f2 Show constraints in Edit Table dialog
Add a new tab to the Edit Table dialog to show a list of all table
constraints. Before this, some of them were visible in the field list
but others were not shown at all. This new view is still rather basic
and currently read-only but will be improved over time.
2019-04-26 12:30:59 +02:00
Martin Kleusberg
e828beb760 parser: Store names of named CHECK constraints
When parsing CREATE TABLE statements, also store the names of named
CHECK constraints for columns.
2019-04-26 11:20:52 +02:00
Scott Furry
5c1cf8a0a8 Resolve sign conversion warnings - prefetch preference
Resolve warnings that occur when building w/ ALL_WARNINGS enabled. Source tree
examined to enusre prefetch size is handled as type std::size_t. Also, tree was
modified correcting handling of the chunkSize variable in sqlitetablemodel that
uses the prefetch preference setting.

Also, some minor editing of sources was taken to improve readability
as well as consistency.
2019-04-25 15:51:25 +02:00
mgrojo
7b6bc013cd Improvements in the Conditional Formats Dialog
- Empty condition means: apply format to any row.
- Rearranged dialog upper buttons so it resembles the Edit Table Dialog.
- Added Help button: link to wiki page.
- Added Reset button: clear all conditional formats in the dialog.
- Fixed some glitches in the move commands: open editors were sometimes
closed, using currentIndex and selectedItems caused inconsistencies.
- Select colour with a single click and show it in the tooltip.
- Remove the unneeded colour name in the colour cells.

See issue #1815
2019-04-13 13:33:24 +02:00
mgrojo
c2eedbc20d Restore full conversion check for non truncated strings
The new text detection check implemented in
e2443d685f was giving problems with some
short by combinations that could look like as a truncated valid UTF-8
sequence, so it is better to only do this text, when the string has been
truncated. In this way, short byte sequences should be correctly checked.

See issue #1846
2019-04-12 20:14:11 +02:00
Justin Clift
6565cdccff Add R-Tree and Geopoly extensions to our win32 nightly build 2019-04-09 03:09:18 +10:00
Justin Clift
5bf90150fc Add Soundex extension to our windows nightly builds 2019-04-09 03:05:22 +10:00
mgrojo
cb3ac2aa2a Prompt to save changes in project when closing DB or application
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
2019-04-06 20:15:05 +02:00
Justin Clift
12c53f7504 Add the formats and fileio extensions to our night macOS builds 2019-04-06 11:05:19 +11:00
Justin Clift
0d25d11bc1 Inlude the fileio extension with our windows builds
Thanks Karim for solving the compile problem! :)
2019-04-06 07:43:54 +11:00
mgrojo
9e6bd05f35 Avoid ambiguity for Ctrl+F in the Execute SQL tab
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
2019-04-05 20:54:09 +02:00
mgrojo
5ca95a57bc Find dialog based on the Find/Replace dialog for the Scintilla widgets
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
2019-04-04 23:49:35 +02:00
Martin Kleusberg
eb2a6e0bd8 Add very basic reloading of modified SQL files
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.
2019-04-04 19:39:03 +02:00
Martin Kleusberg
1aa7bbef87 Move code for opening and saving SQL files to the SqlExecutionArea
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.
2019-04-04 19:18:39 +02:00
Martin Kleusberg
cc8401fb27 Fix compilation for older versions of SQLite
See issue #1837.
2019-04-04 17:22:12 +02:00
Martin Kleusberg
d4401f9705 Update qhexedit2 library to version 0.8.6
See issue #1808.
2019-04-04 13:38:57 +02:00
Justin Clift
e973b4f59f Update currentrelease file for 3.11.2 2019-04-04 08:15:19 +11:00
Justin Clift
3080036bb2 Updated issue templates for 3.11.2 2019-04-04 08:10:19 +11:00
Justin Clift
34ec456155 Updated README with 3.11.2 release date and download links 2019-04-04 06:31:03 +11:00
Karim ElDeeb
d981218690 Fix formats extension
See issue #1831.
2019-04-03 18:48:12 +02:00
Justin Clift
fcfa7c9d7c Automatically sign our nightly build .dmg files too 2019-04-03 22:14:21 +11:00
Martin Kleusberg
fcac61da64 Simplify the WITHOUT ROWID code a bit
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.
2019-04-03 12:19:53 +02:00
mgrojo
25715bb590 Add min & max in selection to the status bar and always show rows & columns
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.
2019-04-03 11:51:35 +02:00
mgrojo
4d5e841813 Show info in status bar when a selection is made in Data Browser
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.
2019-04-03 11:51:35 +02:00
Justin Clift
5de6adeb42 Added Korean translation updates from PR #1600 2019-04-03 15:56:41 +11:00