Commit Graph

2073 Commits

Author SHA1 Message Date
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
Martin Kleusberg
a1855d8f75 dbhub: Don't allow invalid file or branch names in push dialog
See issue #1136.
2017-10-05 23:10:11 +02:00
Martin Kleusberg
5de8f73723 Use a more sophisticated method for detecting image data in Edit dialog
In the Edit Data dialog we check if the data contained in a cell is an
image. This check returned some false positives, so this commit adds
another more sophisticated check to work around that.

See issue #1138 and #1159.
2017-10-05 22:47:02 +02:00
Martin Kleusberg
24ee209bef dbhub: Use URL returned by server 2017-10-05 22:38:01 +02:00
Justin Clift
d73859736d dbhub: Use a fixed format string when transmitting last modified dates 2017-10-02 12:58:30 +01:00
Justin Clift
64b33413fb dbhub: Include TZ with lastmodified date sent to server 2017-10-02 00:05:12 +01:00
Martin Kleusberg
c692ae0de5 dbhub: When pushing a database, save the new commit id and/or the file
When pushing a local database to the remote server, the new commit id is
returned. Grab that id and insert it into the database of local
checkouts. If there already is an entry for the given file, update that
record. When doing an initial push of a database, also copy the source
database file to our checkout directory to avoid redownloading the file
upon first use.

This should eliminate all unnecessary database downloads, both after
doing the initial push and after committing a modified database.
2017-09-30 16:05:01 +02:00
Martin Kleusberg
8c0e4bfdaa dbhub: Send last modified date when pushing database
Also add some code for receiving the last modified data when fetching
but we're not yet able to set it.
2017-09-30 14:47:19 +02:00
Martin Kleusberg
f926a67dba dbhub: Add foce push option to push dialog 2017-09-30 14:07:18 +02:00
Martin Kleusberg
b2ddcdd470 dbhub: Only keep one record per checked out file
Instead of just adding and adding records to the local checkout
database, search for a previous checkout and update its record. This
avoids all sorts of problems in the rest of the code which always
assumed that there is only one record per file.
2017-09-30 13:35:40 +02:00
Martin Kleusberg
f18064f0ae dbhub: Change schema of local database
Also delete the upgrade mechanism that was put in place because it won't
be that easy anyway later on.
2017-09-30 13:02:18 +02:00
Martin Kleusberg
fef884a4e1 dbhub: Send last known commit id along with the database when pushing 2017-09-30 12:57:46 +02:00
Martin Kleusberg
8a540a2745 dbhub: Add column for branches to local database 2017-09-30 12:43:50 +02:00
Martin Kleusberg
34df190729 Silence some cmake warnings
See issues #635 and #1143.
2017-09-30 12:19:55 +02:00