Commit Graph

1778 Commits

Author SHA1 Message Date
Martin Kleusberg
1e9fec270b Merge automatic update check into dbhub.io code
Move the network part of the automatic version check code into the
dbhub.io parts. While semantically this doesn't make a lot of sense it
simplifies the code a bit, reduces the size of the main window class,
and avoids duplication of code e.g. when introducing proxy support.
2017-03-19 17:29:20 +01:00
Martin Kleusberg
dec1c6acb1 dbhub: Code refactoring 2017-03-19 16:56:14 +01:00
Martin Kleusberg
7426e2c143 dbhub: Fix progress dialog
Fix progress dialog interfering with the save file dialog.

Fix cancelling of progress dialog. Before this you couldn't download a
file anymore after cancelling a download.
2017-03-18 21:36:09 +01:00
Martin Kleusberg
d2dc1870a9 Fix compiler warnings 2017-03-18 21:25:07 +01:00
Martin Kleusberg
22791e5b26 Fix possible build error 2017-03-18 21:21:07 +01:00
Martin Kleusberg
0f75ad54b2 Fix possible build error 2017-03-18 21:09:43 +01:00
Martin Kleusberg
3e4f3fc3d2 dbhub: Add remote dock with directory browsing support
This adds a new dock to the main window that contains all the remote
functionality (or is supposed to contain it all in the future).

It also adds a directory browsing feature which allows you to browse
through the folders and files on the dbhub server.

By double clicking a database you can download and open it. The Open
Remote menu action isn't needed anymore and has been removed.

This also fixes an issue with pushing databases where, after sending the
file is completed, the save dialog was opened.

Note that this is still WIP and is far from polished.
2017-03-18 20:40:59 +01:00
Martin Kleusberg
dc3550ee6a dbhub: Add another root CA for testing 2017-03-16 20:59:59 +01:00
Martin Kleusberg
cf08c26e21 grammar: Fix assignment of table information
See issue #975.
2017-03-16 17:10:00 +01:00
Martin Kleusberg
f67817ee68 Simplify code for reloading settings
This simplifies the code for reloading the settings in the Execute SQL
area.

It might also fix a bug where setting a new font for the success/error
message at the bottom of each Execute SQL tab would be overwritten to
Monospace immediately after setting it.
2017-03-16 16:59:23 +01:00
Justin Clift
836966dcf5 Merge pull request #972 from prutz1311/master
Fix plotting with datetimes on x axis (#738)
2017-03-05 13:50:29 +00:00
Oleg Prutz
84a5030d9e Fix plotting with datetimes on x axis (#738)
Use QDateTime::toMSecsSinceEpoch() instead of
deprecated QDateTime::toTime_t() which does not
correctly convert datetimes which do not exist
due to switch to Daylight Saving Time
2017-03-05 16:28:11 +03:00
sacha schutz
8ac4c0342a Add absolutePath to the recent Menu. Fix #965 (#967) 2017-02-28 15:44:39 +01:00
probonopd
3c526f9505 Create AppImage 2017-02-26 13:57:53 +00:00
Martin Kleusberg
fd1f4f2d88 grammar: Detect parse errors in primary key and unique constraints
When having a table definition like this, detect the parse errors in the
table constraints correctly:

CREATE TABLE test(
	a INTEGER,
	b TEXT,
	PRIMARY KEY(a ASC),		-- ASC here
	UNIQUE(b COLLATE NOCASE)	-- COLLATE here
);

The next step is to actually parse and store this information.
2017-02-17 15:28:57 +01:00
Martin Kleusberg
9ea807f67f grammar: Parse collations in column definitions
Parse the COLLATE term in CREATE TABLE statements like these:

CREATE TABLE test(a TEXT COLLATE NOCASE);

See issue #411.
2017-02-17 13:50:42 +01:00
Martin Kleusberg
bef6dc045f grammar: Simplify code 2017-02-17 13:41:43 +01:00
Martin Kleusberg
eddeb78e27 Never set integer primary key fields to empty string
Don't attempt to set an INTEGER PRIMARY KEY field to an empty string as
it will always result in a 'datatype mismatch' error by SQLite. Instead
set it to '0'.

See issue #859.
2017-02-15 22:55:47 +01:00
Martin Kleusberg
85334330a5 cmake: Add options to disable usage of distribution's libraries
This adds two new options to the cmake script which, when set, force
cmake to use the version of the Antlr or QScintilla library in our
repository and not search for a system-wide version of the library.

See issue #961.
2017-02-15 22:13:35 +01:00
Martin Kleusberg
b5345fe676 Update QHexEdit library to 0.8.3
This adds support for editing the ASCII data on the right side of the
hex editor widget.
2017-02-14 18:00:52 +01:00
Martin Kleusberg
81c0cf3d4c Fix memory leak (Coverity) 2017-02-11 21:22:22 +01:00
Martin Kleusberg
47cfd55fa6 Add Coverity badge to Readme file 2017-02-11 21:19:09 +01:00
Martin Kleusberg
304e179bcf Increase size of foreign key editor widgets
See issue #951.
2017-02-03 17:28:47 +01:00
Martin Kleusberg
c62d291042 Add keyboard shortcuts for switching the currently browsed table
Add two new keyboard shortcuts for switching the currently selected
table in the Browse Data tab. These work as long as the table widget is
active. For now I have set them to Ctrl+PageUp and Ctrl+PageDown.

See issue #536.
2017-02-02 22:07:49 +01:00
Martin Kleusberg
bf5ab01d7f Save some space in the Database Structure tab
See issue #620.
2017-02-02 21:44:03 +01:00
Martin Kleusberg
8ceb72d819 Support filtering for NULL values
See issue #588.
2017-02-02 21:36:42 +01:00
Martin Kleusberg
4794b0d231 Try to fix all 'not an error' errors in the Execute SQL tab
See issue #478.
2017-02-01 18:59:56 +01:00
Martin Kleusberg
934dd396f4 Fix execution of problematic SQL scripts leading to empty commands
This fixes the execution of those SQL scripts that by some way or
another are either containing or leading to empty commands. Most notably
this includes two consecurity semicolons and completely empty scripts.
2017-02-01 18:36:11 +01:00
Martin Kleusberg
c68303478a Unify and (hopefully) simplify generation of savepoint names
This shouldn't change anything for the user.
2017-01-31 19:35:35 +01:00
Martin Kleusberg
665837ff25 Improve error handling in execution of SQL commands
This improves the error handling when executing multiple SQL commands at
once in a couple of ways.

We didn't detect any sort of possible error. For example syntax error
were reported and execution stopped but constraint errors were just
silently ignored. This is fixed now so that no silent errors should
occur.

Also we would execute the statements one after another until hitting an
error and then just stop, even if a savepoint was created before. With
this commit we're now reverting back to this savepoint and telling the
user about this. This should bring the database back to a consistent
state.

We have to remove any transaction statements from the SQL statements
because we're always already in a transactions and they can't be nested.
However, when removing a BEGIN TRANSACTION statement this would happen
silently and not in all cases a savepoint would be created instead. This
is fixed as well by making sure a savepoint is always created by this
function when a transaction was in the original list of commands.

See issues #955 and #957.
2017-01-31 19:13:49 +01:00
Martin Kleusberg
036e4349e0 Fix crash when clicking Create Index in empty database
This fixes a crash that would happen if you click the Create Index
button while having opened an empty database file, i.e. without any
table to create an index on yet.
2017-01-31 18:56:42 +01:00
Martin Kleusberg
8da626250d Make sure to register the regexp function when creating a new database
DB4S comes with its own default implementation for the REGEXP function.
This function, however, needs to be registered in order for SQLite to
use it. We did that when opening a database file but not when creating a
new database file, so regular expressions wouldn't work for newly
created databases like they did for existing ones. This is fixed by this
commit.
2017-01-31 18:28:16 +01:00
Martin Kleusberg
bf1c90a896 Fix crash when browsing views
See issue #953.
2017-01-30 21:19:36 +01:00
Martin Kleusberg
2981351cc6 Pretty-print CREATE statements in SQL export
When exporting a database to an SQL file, output the CREATE statements
in a standardised format, including line breaks, indentation and proper
quoting. This requires our grammar parser to fully understand the schema
of a database object in order to make sure no information is lost during
the export. Because of this we fall back to the old way of doing this
for all database objects that couldn't be fully parsed.

See issue #629.
2017-01-27 18:07:02 +01:00
Oleg V. Polivets
a75f2dac11 Range operator for Filter (#939) 2017-01-27 12:41:25 +01:00
Martin Kleusberg
901e087c98 Add index columns to database structure tree
In the Database Structure tab and dock tree widgets, make the indices
expandable and show their indexed columns as child nodes.
2017-01-27 12:31:08 +01:00
Justin Clift
28ddbc493f Merge pull request #947 from schdub/issue945
fix: message 'field already exists' for non existent fields
2017-01-26 16:15:56 +00:00
schdub
0c10dbdd8d fix: message 'field already exists' for non existent fields 2017-01-26 16:03:21 +03:00
Oleg V. Polivets
8d8207043b FIX: Endless loop in EditTableDialog::addField (#943) 2017-01-25 18:22:49 +01:00
Vladyslav Tronko
36a3815984 Don't show foreign key tooltip within Execute SQL tab (#942)
This is probably just temporary solution. Tooltip code was written
specifically for Browse Data tab, so it requires some versatile changes.
2017-01-25 14:17:05 +02:00
Martin Kleusberg
f728ff73ab Remove useless function in Edit Table dialog 2017-01-23 22:08:19 +01:00
Martin Kleusberg
b6b94a8a93 Overload the assignment operators for the Table and Index classes
This fixes issues that assigning the main representation of the database
in DBBrowserDB::objectMap is modified when playing around with the
database in the Edit Table and Edit Index dialogs.

These bugs were caused by my refactoring. Let's hope there's not much
more fallout from this refactoring...
2017-01-23 22:04:28 +01:00
Martin Kleusberg
38144bbcad Finish main part of the recent refactoring effort
This finally gets rid of the DBBrowserObject class entirely and moves
all its functionality to the newer classes in the sqlb namespace.

I'm still not entirely happy with this but at least things should be a
little more consistent now.
2017-01-23 20:59:12 +01:00
Martin Kleusberg
383925652f Don't use base table name where the actual table name is appropriate
In the SQL export don't use the base table name of a table when you
should actually use the table name itself. The way SQLite reports its
data these just happen to be the same for tables.

This doesn't change anything when it comes to functionality but is
semantically more correct.
2017-01-23 17:21:58 +01:00
Martin Kleusberg
9266d207cd grammar: Add stub for the trigger class 2017-01-23 17:20:42 +01:00
Martin Kleusberg
f8165d475c Make a method private 2017-01-23 17:09:24 +01:00
Martin Kleusberg
d236f6df9f grammar: Introduce basic View class stub
Parsing views or generating a CREATE VIEW statement isn't implemented
yet.

Also unify the process by which it's possible to retrieve information on
the fields of a database object.
2017-01-23 17:06:41 +01:00
Martin Kleusberg
ebc3869627 Rename sqlb::Object::ObjectTypes enum to sqlb::Object::Types
The 'Object' parts seemed a little redundant before.
2017-01-23 13:44:36 +01:00
Martin Kleusberg
649f2b8b93 Simplify include file 2017-01-23 13:36:31 +01:00
Martin Kleusberg
00ac4aaa51 Try fixing the Travis build 2017-01-22 21:36:53 +01:00