Commit Graph

2086 Commits

Author SHA1 Message Date
Martin Kleusberg
9b309402db Better BLOB detection in the Browse Data tab
This improves the BLOB detection in the Browse Data tab which was
working pretty poorly because it was only looking for null bytes, not
for any other non-printable characters.

See issue #1201.
2017-10-29 13:39:24 +01:00
Martin Kleusberg
557ef399bb Rename "Not null" column to "NN" in Edit Table dialog
The "Not null" text didn't fit in the column width anyway and this makes
it more consistent with the other constraint columns.

See issue #1184.
2017-10-29 13:14:09 +01:00
Martin Kleusberg
4a386dd6a3 Add missing include 2017-10-29 11:37:58 +01:00
Martin Kleusberg
56630a20e5 Don't use system locale when parsing SQL statements
Antlr uses the current system locale when parsing SQL statements. This
is problematic because SQL is case-independent and for converting
characters to lower/upper case it is going to use the locale. For
Turkish however this adds implicit conversions between the dotted and
dotless I which triggers another problem in Antlr: it doesn't cover the
whole Unicode character set. This commit fixes the implicit conversions.

See issue #1194.
2017-10-27 18:42:43 +02:00
Martin Kleusberg
18b781495c Simplify code 2017-10-27 18:36:39 +02:00
Martin Kleusberg
955848f957 Improve detection of query vs. modify statements in Execute SQL tab
This should improve the detection of read-only query statements vs.
modifiying statements in the Execute SQL tab. The idea is to stop
looking for the SELECT keyword at the beginning of the statement and
instead fully rely on whether SQLite returns any data for this
statement.

See issue #1185.
2017-10-27 18:36:39 +02:00
Martin Kleusberg
b9595b9b7e Remove the valid flag from the SqliteTableModel class
Remove the valid flag from the SqliteTableModel class and remove its
usage in the Execute SQL tab of the main window. I believe this hasn't
been used for some time now because the main sources of error should
really be noticed before the query is even handed over to the model.
Additionally the valid flag wasn't as realible either anymore because of
the multi-threaded execution of the model queries.
2017-10-27 18:36:39 +02:00
mgrojo
9fd4ebe0e0 Fixed crashed when editing the display format and the currently browsed table name is actually a view.
Now it is checked the object type before the cast. This avoids the crash and the field name is obtained for each case.
2017-10-27 11:50:38 +02:00
Martin Kleusberg
c69314f566 Fix ampersand not showing up in dialog when renaming SQL tabs
This didn't work on Windows as pointed out by Chris Locke.
2017-10-27 11:30:59 +02:00
Martin Kleusberg
66fa44497d Try to fix build on Windows
See issue #1193.
2017-10-26 23:24:04 +02:00
m4rt1nq
ae0da5fdce Fix ‘size_t’ does not name a type compile error 2017-10-24 12:30:12 +01:00
mgrojo
c5fff20fb8 Spanish translation reviewed and updated (#1190) 2017-10-23 16:47:45 +01:00
Martin Kleusberg
04e8119049 Add basic function for cancelling queries
This doesn't do all the work yet and isn't called anywhere. So don't
expect this to do anything useful.
2017-10-22 18:34:33 +02:00
Martin Kleusberg
d126e86e81 Make sure to not re-run the query if the filters haven't changed
When changing between the filter line edits in the Browse Data tab, make
sure to only re-run the SQL query if the value of the filter line edits
have actually changed.

See issue #1187.
2017-10-22 18:29:54 +02:00
Martin Kleusberg
bc91126b2c Allow renaming SQL tabs by double clicking them
See issue #1186.
2017-10-22 14:08:52 +02:00
mgrojo
5cef432159 New option in the context menu for using the value as filter (#1182)
* Added an option in the context menu for using the currently selected cell
as filter in this column. This allows quick filtering by selected values.

* Changes to pull request #1182 requested by @MKleusberg: get internal cell data and check for the NULL special case.
2017-10-21 22:24:43 +02:00
Martin Kleusberg
37e5b62842 Make code easier to read 2017-10-20 17:47:04 +02:00
Martin Kleusberg
9cff69f534 Better error messages
Show better error message in some cirsumstances. This is most notable
when dropping a (database) file onto the structure tree view when no
database file is opened.
2017-10-20 17:13:34 +02:00
Martin Kleusberg
92a868132b More fine-grained locking
See issue #1178.
2017-10-20 15:37:55 +02:00
Martin Kleusberg
fd97cdef45 Try fixing deadlock
See issue #1178.
2017-10-19 15:46:44 +02:00
Martin Kleusberg
61d9fef7eb Don't override built-in collations
Don't ask the user whether to load a collation function if the requested
collation is already built into SQLite. Also, never override the
built-in functions.

See issue #1172.
2017-10-19 15:12:06 +02:00
Martin Kleusberg
4ae601dafd Fix default collation for UTF16 strings
Fix our default collation which we install when an unknown collation is
requested to (more or less) support UTF16 strings as well. Before this
UTF16 strings wouldn't compare correctly because they might contain null
bytes which would lead to only the first (few) byte(s) getting compared.

See issue #1172.
2017-10-19 14:54:30 +02:00
Martin Kleusberg
32da4de94d Fix collate warning after addition of multi-threaded loading
The no collate function warning is triggered in a thread which is used
for loading data. However, the warning is a message box and GUI elements
can only be drawn in the main thread. So the old code would crash. This
is fixed here by jumping to the main thread for showing the message box.
2017-10-16 21:58:30 +02:00
Martin Kleusberg
681456733e Improve locking in SQLiteTableModel 2017-10-16 21:54:33 +02:00
Martin Kleusberg
973f97c1eb Move row count query into a separate thread
In the SqliteTableModel class we need to know the total number of rows
in the table or returned by the query. This takes a considerable amount
of time and can be moved into a separate thread. I haven't done any
performance measurements with this but it might speed up switching
between large tables a bit.
2017-10-15 11:46:47 +02:00
Martin Kleusberg
3ae4267a8b Fix column widths in Execute SQL tab after multi-threading
This fixes the automatic column width adjustment in the Execute SQL tab
results view. This was broken by the introduction of multi-threaded
loading of the table data.
2017-10-15 11:39:55 +02:00
Geoff Lawrence
65454d02f3 Merge pull request #1171 from Armour/patch-1
Update README.md
2017-10-15 07:09:02 +01:00
Chong Guo
5aaf4ab1e5 Update README.md 2017-10-14 21:22:22 -07:00
Martin Kleusberg
f60c059b87 Fix horizontal tiling in Execute SQL tab
See issue #380.
2017-10-13 10:40:31 +02:00
Martin Kleusberg
3c1c6af18b Fix crash on Windows
See issue #1169.
2017-10-12 17:44:52 +02:00
Justin Clift
c0b67ab4a8 Merge pull request #1168 from kehugter/master
Remove `activateWindow()` when EditDock is toggled
2017-10-12 15:22:26 +01:00
kehugter
c4c4cf62a2 Remove activateWindow() when EditDock is toggled
There's no need to set sqlitebrowser as active window when updating
the main application window. The `activateWindow()` call prevents
switching workspaces in GNOME and Cinnamon desktops.

Fixes #934
2017-10-11 22:54:06 +02:00
Martin Kleusberg
ce18198bbf Improve splitter in Execute SQL tab
Set a maximum height for the error area in the Execute SQL tab. This way
it doesn't occupy as much space by default.

Use two separate splitters instead of just one. This fixes the
horizontal tiling option.

See issue #380.
2017-10-11 19:06:54 +02:00
Martin Kleusberg
f4c27888f1 Fix editing data after multi-threaded loading 2017-10-11 10:50:58 +02:00
Martin Kleusberg
5ea6b1a76d Fix recordset label in Browse Data tab 2017-10-11 09:21:41 +02:00
Martin Kleusberg
60ae015fe9 Fix build error 2017-10-11 09:21:41 +02:00
Martin Kleusberg
bb4aeb6210 Fix warning 2017-10-11 09:21:41 +02:00
Martin Kleusberg
bfa2fda1ad Attempt to implement multi-threaded loading of data
This is mostly done by trial & error. Don't expect any miracles from
it.
2017-10-11 09:21:41 +02:00
Martin Kleusberg
6029e25bcc Store row columns in a vector instead of a list
This should speed things marginally up.
2017-10-08 20:06:49 +02:00
Martin Kleusberg
fd8960cd49 Fix double queries in Browse Data tab
This avoids querying the database twice when selecting a new table. It's
an easy fix which works in most circumstances (all except for views with
enabled view editing). It can always be improved if necessary.

See issue #1108.
2017-10-07 18:21:22 +02:00
Martin Kleusberg
d5e4fe9f66 Clean up code 2017-10-07 18:00:48 +02:00
Martin Kleusberg
c1aa7a34b4 Fix path comparison when checking for attached databases
See issue #1133.
2017-10-06 12:33:04 +02:00
Martin Kleusberg
eff92c2818 dbhub: Better validation in push dialog
This makes it more obvious to the user where the error in the input is
by just now allowing invalid characters.

It also prevents an annoying error message from popping up when entering
invalid database names and changing focus to another field afterwards.

See issue #1136.
2017-10-06 11:39:00 +02:00
Martin Kleusberg
8a7b662435 Fix crash when editing table after changing its schema
Fix a crash which happened when opening a table in the Edit Table dialog
for modification and changing its schema and then (without reopening the
dialog) change the schema again or doing some other modifications to the
table.

See issue #1131.
2017-10-06 00:04:06 +02:00
Martin Kleusberg
3e02420256 Escape new schema name when altering a table
When moving a table to another schema with a name which needs to be
escaped, this would have generated an error prior to this commit.
2017-10-05 23:50:47 +02:00
Martin Kleusberg
3d26c1154c Don't allow attaching the same database twice
See issue #1133.
2017-10-05 23:45:22 +02:00
Martin Kleusberg
59b39bbb95 Don't query foreign key settings repeatedly in Edit Table dialog
When changing the table name in the Edit Table dialog, don't query the
foreign key pragma for every key stroke.

See issue #1130.
2017-10-05 23:32:06 +02:00
Martin Kleusberg
b24894f4c3 Allow empty names for attached databases
An empty database name is not the same as pressing the cancel button
when attaching a database.

See issue #1132.
2017-10-05 23:23:36 +02:00
Martin Kleusberg
1cd93ed045 Suggest a schema name when attaching a database
See issue #1132.
2017-10-05 23:21:37 +02:00
Martin Kleusberg
a5ebcbb55c Also remember databases with no objects
When attaching a database that is empty, i.e. has no objects in it,
include it in the schema map, too.

See issue #1132.
2017-10-05 23:17:19 +02:00