Commit Graph

2025 Commits

Author SHA1 Message Date
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
Martin Kleusberg
1666bb5606 Improve speed of preview table for large fields in Import CSV dialog
See issue #720.
2017-09-29 23:21:39 +02:00
Martin Kleusberg
bbc4ad5b19 Don't reset the table name as easily in the Import CSV dialog
See issue #1072.
2017-09-29 23:08:39 +02:00
Martin Kleusberg
263f075d8d Add splitter to the Import CSV dialog
This adds a splitter between the CSV file list and the file preview in
the Import CSV dialog.

See issue #1072.
2017-09-27 21:27:34 +02:00
Martin Kleusberg
cbd5d15cf5 Add a way to cancel the entire CSV import
See issue #1121.
2017-09-27 20:59:30 +02:00
Martin Kleusberg
425bfa1e75 Improve 'Yes for all' button in CSV import dialog
See issue #1121.
2017-09-27 15:52:34 +02:00
Martin Kleusberg
d2185d234b csv: Don't ask whether to import into existing table every time
Add a 'Yes for all' button to the "There is already a table of
that name..." message box in the Import CSV dialog.

See issue #1121.
2017-09-27 14:18:38 +02:00
Martin Kleusberg
4dc5286596 dbhub: Fix possible crash
This fixes a crash that occurs if there is an error while fetching
something other than a database and no database has been downloaded
before, e.g. when getting the root directory listing fails.
2017-09-25 14:36:31 +02:00
Jiří Techet
18bcbf138f Fix extra spaces in type definitions with parentheses
At the moment space is inserted between all tokens from which a type
consists. This adds extra spaces to types like VARCHAR(5) which become
"VARCHAR ( 5 )" which causes problems in some applications.

This patch modifies the way tokens are concatenated for a type. It makes
sure that the extra space isn't inserted before "(" and ")" and also
after "(".
2017-09-22 20:10:09 +02:00
Justin Clift
c5e91976c8 Update currentrelease to 3.10.1 2017-09-20 18:54:48 +01:00
Justin Clift
efd8514107 Added 3.10.1 to README.md release history 2017-09-20 17:07:39 +01:00
Justin Clift
1723ba10b9 Add 3.10.1 to the issue reporting template 2017-09-20 16:59:32 +01:00
Martin Kleusberg
e3b9027bd0 Add missing include
See issue #1148.
2017-09-20 16:54:46 +02:00
Martin Kleusberg
8f82f26d4f Visual optimisation for the CSV import process
When importing multiple CSV files at once, remove each entry from the
list of CSV files as its import completes. This way people can see the
list shrink visibly onscreen.

Also don't close the window if there are still files left to be
imported. This allows the user to import unchecked files, too, probably
using different settings.

See issue #1072.
2017-09-19 21:43:30 +02:00
Jiří Techet
969d3e470a Fix custom type saving when only focus changes for user-entered type
At the moment when user types a custom type into the type combo box and
doesn't press enter, the entered type isn't used. This patch tries to fix
the problem by installing an event filter for the combo box and checking
when it loses focus - when it does, it performs type updates too.

On the way the patch also changes the signal used inside moveCurrentField()
from activated() to currentIndexChanged() to make it consistent with the
rest of the file.
2017-09-19 21:10:03 +02:00
Martin Kleusberg
2f304e0957 Add automatic data type detection to the CSV import
When importing a CSV file into a table that doesn't exist yet (i.e. that
is created during the import), try to guess the data type of each column
based on the first couple of rows. If it is all floats or mixed floats
and integers, set the data type to REAL; if it is all integers, set the
data type to INTEGER; if it is anything else, set the data type to TEXT.

See issue #1003.
2017-09-18 21:44:34 +02:00
Martin Kleusberg
d4e228d4b5 Make hidden columns persistent
With this commit the main window keeps track of the hidden columns and
re-hides them when the table is selected again. It also saves the hidden
status to the project file and restores it from there.
2017-09-18 20:41:27 +02:00
Peter Hyatt
c5c3d2366e Added hide selected columns and show all columns to tableview context menu.
Added a fix for building with MingW on Windows.
2017-09-18 19:47:27 +02:00
Martin Kleusberg
659f38ebef Increase CSV parser performance 2017-09-18 15:10:43 +02:00
Martin Kleusberg
28446a4f0c Fix memory leak 2017-09-17 18:23:04 +02:00
Martin Kleusberg
677d36074a grammar: Add support for parsing multiple FKs in column constraints
This adds support for multiple foreign keys in a column constraint.
Example:

CREATE TABLE t1(a int, b int);
CREATE TABLE t2(a int, b int);
CREATE TABLE test(
    x int REFERENCES t1(a) REFERENCES t2(a),	-- This is now supported
    y int
);

Multiple foreign keys if they are a table constraint were already
supported before.
2017-09-15 11:00:25 +02:00
Martin Kleusberg
d73fbfc156 Don't leak memory for multiple PK constraints per field (Coverity)
This should really never happen because SQLite doesn't allow statements
like

CREATE TABLE test(
    a int PRIMARY KEY PRIMARY KEY,
    b int
);
2017-09-15 10:54:08 +02:00
Martin Kleusberg
f20f996767 Fix uninitialised member problems (Coverity)
None of them seem to be critical though.
2017-09-15 10:39:38 +02:00
Martin Kleusberg
0eb1f65798 Optimise the CSV import performance
This commit bundles a number of smaller optimisations in the CSV parser
and import code. They do add up to a noticible speed gain though (at
least on some systems and configurations).
2017-09-13 15:03:13 +02:00
Martin Kleusberg
6ed8080fdb Don't parse entire CSV file before inserting the first row
We were separating the CSV import into two steps: parsing the CSV file
and inserting the parsed data. This had the advantages that it keeps the
parsing code and the database code nicely separated and that we have
full knowledge of the CSV file when we start inserting the data into the
database. However, this made it necessary to keep the entire parser
results in RAM. For large CSV files this uses enormous amounts of
memory.

This commit changes the import to parse the first 20 lines and analyse
them. This should give us a good impression of what to expect from the
rest of the file. Based on that information we then parse the file row
by row and insert each row into the database as soon as it is parsed.
This means we only have to keep one row at a time in memory while more
or less keeping the possibility to analyse the file before inserting
data.

On my system this does seem to change the runtime for small files which
take a little longer now (<5%), though these measurements aren't
conclusive. For large files it, however, it changes memory consumption
from using all memory and starting to swap within seconds to almost no
memory consumption at all. And not having to swap speeds things up a
lot.
2017-09-12 10:37:28 +02:00
Justin Clift
e0ced4a0fa Rearranged display format list alphabetically
Was starting to look a bit weird otherwise. :)
2017-09-11 13:04:23 +01:00
Grif392
46ec019719 Add Java Epoch format conversion
Java epoch is measured in milliseconds from unix 0; conversion is a
(roundabout, best I could find) way to convert milliseconds into a
SQLite datetime while keeping millisecond resolution.

Easier alternative would be column_name / 1000, but loses _some_
theoretical resolution.
2017-09-11 00:30:23 +02:00
Oleg Prutz
ae8df56d9e Clear column filters after table modification
Fixes #1020. Clear values in the filter boxes
on the `Data` tab every time the table structure
changes.
2017-09-10 23:58:31 +02:00
Martin Kleusberg
fb6ea5ac60 Make text selectable in Edit dock even if db is opened as read only
Instead of disabling the entire edit dock when the database is opened in
read only mode, only disable all buttons for making changes to the
field. This way the data can still be read using the edit dock.

See issue #1123.
2017-09-10 15:19:03 +02:00
Martin Kleusberg
f28bb151b3 Regenerate some .ui files
This shouldn't change anything at all. It's just that Qt Designer keeps
insisting to do these changes and I have finally given in.
2017-09-10 15:06:20 +02:00
Martin Kleusberg
e9d4b3912a Move button for saving Execute SQL results to the toolbar
In the Execute SQL tab, move the button for saving the results of a
query as either a CSV file or a view from the bottom of the results view
to the toolbar at the top.

See issue #1122.
2017-09-10 15:00:31 +02:00
Martin Kleusberg
b7a00d301a Don't track column count when parsing CSV files
When parsing a CSV file we used to check the column count for each row
and track the highest number of columns that we found. This information
then could be used to create an INSERT statement large enough for all
the data.

This column number tracking code is removed by this commit. Instead it
analyses the first 20 rows only. It does that while generating the field
list.

Performance-wise this should take a (very) little longer but makes it
easier to improve the performance in other ways later which should more
than compensate this commit.

Feature-wise this should fix some (technically invalid) corner-case CSV
files with fewer fields in the title row than in the other rows. It
should also break some other (technically invalid) corner-case CSV files
if they are imported into an existing table and have less columns than
the existing table in their first 20 rows but later on the exact same
number. Both cases, I think, don't matter too much.
2017-09-10 11:07:02 +02:00
Martin Kleusberg
67adb99665 Add '<>NULL' filter
Extend the filter syntax to allow filtering for fields that are not
equal to NULL.

See issue #1124.
2017-09-10 10:24:18 +02:00
Justin Clift
dcb71aa1fd Disable automatic AppImage uploading for now
It's just not in usable state atm.
2017-09-08 14:22:18 +01:00
Martin Kleusberg
08e5f532ce dbhub: Fix branch list in push dialog
The JSON format generated by the server has changed.
2017-09-08 14:49:59 +02:00
Justin Clift
c44e8ce9e0 Added missing tag name for the AppImage builds 2017-09-08 11:23:47 +01:00
Martin Kleusberg
8c47c6d668 Add very basic performance measurement to the Import CSV dialog 2017-09-07 22:26:32 +02:00
Martin Kleusberg
6432517805 Use a prepared statement for all records during the CSV import
Don't build a separate SQL statement per row to insert during CSV import
but use a single prepared statement which can be reused for each row.
This should speed up the CSV import noticeably.
2017-09-06 20:38:24 +02:00
Justin Clift
6e40741303 Use alternative upload script, as the original one causes notification spam 2017-09-06 11:08:24 +01:00
Justin Clift
0f7b748c71 Try and stop the release notification spam
As per https://github.com/probonopd/uploadtool/issues/1#issuecomment-259818295
2017-09-05 19:47:22 +01:00
Martin Kleusberg
5f6a1a1688 Try to fix the Windows builds
See issue #1120.
2017-09-05 16:57:15 +02:00
Martin Kleusberg
f01ad409ff Improve error handling when moving table to a different schema
When moving an existing table to a different schema which already
contains a table of that name, this causes an error. With this commit we
try to detect this type of error as early as possible.

This commit also updates the error message for that case. The old error
message still mentioned the 'temporary flag' which isn't correct
anymore.

Also, when changing the schema fails, reset the dropdown box back to a
working schema to avoid any confusion about whether the change worked or
not.
2017-09-04 20:21:56 +02:00
Martin Kleusberg
72d64edbe0 Support creating databases in schemata other than main and temp
This replaces the checkbox for creating tables in the temporary schema
by a dropdown box that lets you select between all available schemata,
i.e. main, temp, and all attached databases. This way it becomes
possible to create new tables in attached databases as well as move
existing tables between all schemata.
2017-09-04 18:15:54 +02:00
Martin Kleusberg
7db96cdf13 Improve movement of tables between different schemata
This improves the Edit Table dialog to better handle moving tables from
one schema to another, though the UI currently only knows about the main
and the temp schema.

This also simplifies the grammar code by removing the temporary flag
from all classes because it's redundant now that we support multiple
schemata.
2017-09-04 17:38:08 +02:00
Martin Kleusberg
a5ca75655c Show attached databases in the UI
Commits 532fcd3f6b,
44eb2d4f99, and
ea1659e1d0 along with some smaller ones
prepared our code for properly handling schemata other than "main".
While working for any schema, they only exposed this funtionality for
the "temp" schema. But with these preparations in place it's easy to add
all known schemata to the UI and enable (almost) all features we have
for them. This is done by this commit, adding all attached databases to
the UI.
2017-09-04 12:45:41 +02:00
Martin Kleusberg
ea1659e1d0 Support schemata other than main in the Browse Data tab
Similar to commit 44eb2d4f99 this commit
makes use of the backend code improvements introduced in commit
532fcd3f6b.

It adds support for database schemata other than "main" to the Browse
Data tab. With this it's possible again to browse and edit data of
temporary tables using the Browse Data tab. This time, however, they are
separated logically from "main" tables. So handling temporary tables
should be a lot less error prone now, plus it's easier to tell for the
user what tables goes in what schema.

This commit changes the project file format. There is some code included
which allows loading of project files in the old format. However,
project files generated using versions after this commit can't be loaded
by older versions of DB4S.
2017-09-04 12:27:52 +02:00
Martin Kleusberg
1a3e3d3c40 Support SQL auto-completion for tables from different schemata
This improves commit 44eb2d4f99 by adding
support for auto completion in the SQL editors for all tables that are
not in the "main" schema.
2017-09-04 10:25:05 +02:00
Martin Kleusberg
315019dd9c Improve foreign key editor when working on tables in non-main schemata
This improves commit 44eb2d4f99 by
allowing to choose tables from other schemata than "main" in the foreign
key editor in the Edit Table dialog. This still isn't perfect as only
tables from the schema of the current table should be shown but with
some care it should work for all use cases.
2017-09-04 10:20:43 +02:00
Martin Kleusberg
fbaf78ea65 Support drag and drop on tables with schema != "main"
This improves commit 44eb2d4f99 so that
drag and drop of data on temporary tables is supported as well.
2017-09-03 21:49:32 +02:00