Commit Graph

949 Commits

Author SHA1 Message Date
Martin Kleusberg
35a68b0d99 Simplify code by removing unneeded 'QObject::' prefixes
Inside methods of the DBBrowserDB class 'QObject::' prefixes aren't needed
anymore since it's a child of the QObject class.
2014-12-01 17:52:38 +01:00
Martin Kleusberg
6d7b40265a cipher: Fix leak and database being locked when opening a normal DB file
Fix a memory leak and make sure the database is being fully unlocked
when opening a normal, not-enrypted database file.
2014-11-29 17:57:09 +01:00
Martin Kleusberg
5991a144a1 EditTableDialog: Don't quote function in default value when marked '=()'
When entering a default value like "=(strftime('%s','now'))", don't
quote it but remove the '=' character and use the following expression
as default value.

See issue #166.
2014-11-29 17:36:54 +01:00
Martin Kleusberg
9e4a6df804 Show if field contains a NULL value
Show 'NULL' for those fields in a table which contain a NULL value. This
allows the user to see the difference between an empty string field and
a NULL field.

Also change the format of the 'BLOB' information shown for binary data
to match the new 'NULL' information.

See issue #163.
2014-11-29 15:02:10 +01:00
Peinthor Rene
31915c4061 compat: change to compile under qt4.7 2014-11-28 19:49:15 +01:00
Peinthor Rene
16b8428b66 sqlite3grammar: fix problems with keywords as columnnames 2014-11-25 22:03:05 +01:00
Peinthor Rene
7587127360 cmake: show antlr sqlite3 grammar in project 2014-11-25 22:01:14 +01:00
Peinthor Rene
73d00b2ae6 exportcsv: fix missing return statements 2014-11-23 20:06:45 +01:00
Peinthor Rene
1ce33792c5 exportcsv: allow to select more than 1 table at a time to export 2014-11-23 11:38:46 +01:00
Peinthor Rene
e814fa2a03 exportsql: real handling of null and empty strings 2014-11-23 09:16:06 +01:00
Peinthor Rene
0f48f1a035 exportsql: don't write empty statements 2014-11-18 21:37:43 +01:00
Peinthor Rene
85578bd9b6 exportsql: only quote if text or blob datatype 2014-11-18 21:37:14 +01:00
Martin Kleusberg
f829f06050 Distinguish Save and Save As when saving SQL files in the Execute SQL tab
When saving a SQL file in the Execute Query tab don't always ask for a
new file name but use the file name used when last saving the tab or
used when a file was opened. Add a 'Save As' menu option with the old
behaviour of always asking for a file name.

See issue #152.
2014-11-15 12:32:30 +01:00
Martin Kleusberg
33e7f6bd55 cipher: Add build instructions 2014-11-14 13:20:22 +01:00
Martin Kleusberg
7bed20f1bf cipher: Proper fix for the is-it-encoded?-trial-and-error problem
Apparently after querying an encrypted database the handle is left in an
inconsistent state. So before setting any key or other encryption
details make sure to close and reopen the database to get a new, valid
handle.

Thanks to Nick (developernotes) and Stephen (sjlombardo) from the
SQLCipher forums for pointing this out!
2014-11-14 12:53:40 +01:00
Martin Kleusberg
efe87a4b6e Clear result view in Execute SQL tab when running a PRAGMA statement
Clear the result table view in the Execute SQL tab of the main window
when a PRAGMA statement was executed that didn't return any rows. Before
this, running e.g. 'PRAGMA table_info(test)' and then 'PRAGMA
table_info(tset)' would still present the result from the first query
even though the second should have cleared the view.

See issue #151.
2014-11-11 19:14:58 +01:00
Martin Kleusberg
3bc93af7e0 cipher: Fix memory leak when cancelling the cipher dialog 2014-11-10 23:02:42 +01:00
Martin Kleusberg
2c9d20d7e9 cipher: Change default page size to 1024 2014-11-10 22:54:15 +01:00
Martin Kleusberg
a4552152af cipher: Fix opening SQLCipher DBs using page size 1024
No idea how this fixes that inconsistency bug described here but it does:
https://discuss.zetetic.net/t/sqlcipher-support-being-added-to-db-browser-for-sqlite/243/6
2014-11-10 22:52:33 +01:00
Martin Kleusberg
f257f9248e Move syntax highlighter objects to SqlTextEdit class
Any SqlTextEdit object has its SQL syntax highlighter anyway, so it
makes sense to move the syntax highlighter object inside the text edit
class instead of maintining somewhere else. This hopefully makes the
code a bit easier to maintain.
2014-11-09 12:20:02 +01:00
Martin Kleusberg
7cfd80621e Don't syntax highlight table names in the middle of other identifiers
Assuming you have a table names 't', the syntax highlighter would have
highlighted all ts in column names and other identifiers which aren't
highlighted otherwise. This is fixed by this commit.
2014-11-09 12:16:19 +01:00
Martin Kleusberg
6e38cbcb1d exportcsv: Remember export settings
Save the settings made in the Export CSV Dialog in the application's
config file.

See issue #149.
2014-11-08 12:30:56 +01:00
Martin Kleusberg
d9da5dcd7f csvimport: Make default settings in code a little easier to understand 2014-11-08 12:17:56 +01:00
Martin Kleusberg
e4af3b0939 csv: Quote fields during CSV export when they contain the separator char
When a field contains the separator character it need to be quoted as
well. On the other hand, checking for \r\n as well as \n is redundant,
so the former check can be removed.

See issue #144.
2014-11-07 21:05:01 +01:00
Martin Kleusberg
3277849121 Add column to EditTableDialog to allow setting foreign key constraints
Add a new column to the fiel table in the Edit Table Dialog to allow the
user to add and edit foreign key constraints.
2014-11-06 18:33:19 +01:00
Martin Kleusberg
4b7766a0fe tests: Add tests for foreign key parsing 2014-11-06 18:29:34 +01:00
Martin Kleusberg
f2c3c2b1a4 Parse and save foreign key constraints
When parsing a CREATE TABLE statement read and try to parse any foreign
key constraints and save that information.
2014-11-06 18:28:28 +01:00
Martin Kleusberg
fca39e9e1c Don't override project file settings right after loading them
This fixes a bug which was introduced during the SQLCipher development
and which caused some settings loaded from a project file to be loaded
but then replaced by the default values which were loaded right
afterwards.
2014-11-06 16:56:08 +01:00
Martin Kleusberg
ea2512d538 cipher: Fix build on Qt4 2014-11-02 19:33:28 +01:00
Martin Kleusberg
a22ed6f9d3 cipher: Add option for changing the encryption used for the current file
Add a new menu option to the main window (only visible when built with
the sqlcipher option enabled) which opens a dialog asking for new
encryption settings. These are then applied to a new database to which
all contents of the current one are exported. The old database is then
replaced by the new one.

This adds support for encrypting plaintext databases, decrypting
encrypted databases and changing the password or other settings of
encrypted databases.

If this turns out to work well enough we have functional SQLCipher
encryption support with only details missing.
2014-11-02 19:06:06 +01:00
Martin Kleusberg
8fb9176f99 cipher: Show encryption status in the main window statusbar
Add a note to the status bar of the main window when an encrpyted
database is opened.

Also make some methods in the CipherDialog class const.
2014-11-02 18:15:13 +01:00
Martin Kleusberg
e12f62515b cipher: Add SQLCipher build to Travis CI 2014-11-02 14:26:10 +01:00
Martin Kleusberg
167d8cbd74 cipher: Fix build option and use a dialog for entering the password
Fix the sqlcipher build option in the qmake project to actually enable
the SQLCipher support.

Add a new dialog called CipherDialog which is used to ask the user for
the password and other encryption details instead of using standard Qt
input dialogs.
2014-11-02 13:12:31 +01:00
Martin Kleusberg
9ba36d02b2 Add initial SQLCipher support
Add some basic initial support for SQLCipher. Note that this is more of
a POC than a final implementation.

This commit adds an option called 'sqlcipher' to the cmake and qmake
projects which - when enabled - replaces the default SQLite3 include and
library files by their SQLCipher counter-parts. Especially on MacOS X
there might be some more work required in finding the correct include
paths. The SQLCipher library supports unencrypted databases, too, so
even if the option is enabled the program behaves like before. You can
see the difference, though, in the About Dialog where the SQLite version
string will say 'SQLCipher version xy'.

When the sqlcipher option is enabled and you try to open a file which is
neither a project file nor a normal SQLite3 database it is assumed now
that the file is an encypted database. There is no way to tell between
an invalid file and an encypted file, so in both cases a password dialog
pops up. When the correct password and page size are entered the file is
opened and can be edited like any other database before.

Creating encrypted databases isn't supported yet. So for testing you
need to fall back to the sqlcipher command line tool.

See issue #12.
2014-11-01 12:56:53 +01:00
Justin Clift
e93392c436 Fixed build-essentials → build essential typo
Thanks @WIStudent for pointing out the typo. 😄
2014-11-01 03:35:08 +00:00
Martin Kleusberg
daa7b7f16e Show tooltips in DB Structure views
When hovering over an item in the tree views of the Database Structure tab
or DB Schema pane, show a tooltip with the contents of that field.

See issue #139.
2014-10-30 18:34:08 +01:00
Justin Clift
3d5fc6ee8d Fixed outdated link to Qt website 2014-10-30 00:37:52 +00:00
Justin Clift
0a5fff9e18 Updated currentrelease to 3.4.0 2014-10-29 23:07:58 +00:00
Justin Clift
1d60d996f1 Updated version in CFBundleVersion to 3.4.99
This reflects it's the development for 3.5.x series.
2014-10-29 23:06:24 +00:00
Justin Clift
b62f529d56 Trivial wording tweak 2014-10-29 21:41:51 +00:00
Justin Clift
91c989639b Added 3.4.0 release date 2014-10-29 20:50:01 +00:00
Martin Kleusberg
722bf3797f i18n: Add Chinese translation to project files 2014-10-29 19:46:29 +01:00
Peinthor Rene
805d6dbeff Merge pull request #138 from efreeking/patch-2
I18N - Simplified Chinese
2014-10-28 08:45:45 +01:00
efreeking
d3d7bd767f I18N - Simplified Chinese 2014-10-27 09:17:25 +08:00
Peinthor Rene
adf34baa36 gitignore: add testdata directory 2014-10-26 18:37:44 +01:00
Justin Clift
3a6f43a174 Adjust OSX wording to show 10.6 through to 10.10 work 2014-10-26 17:28:09 +00:00
Peinthor Rene
f68cf4c86a Merge pull request #136 from manisandro/icon
Install icon to hicolor directory
2014-10-26 15:43:52 +01:00
Sandro Mani
1491a9318e Install icon to hicolor directory 2014-10-26 09:30:01 +01:00
Peinthor Rene
8c5dfbb977 sqlexport: rewrite "to sql file" export to use streaming 2014-10-23 20:56:09 +02:00
Justin Clift
4f00f2119c Merge pull request #134 from vertexclique/patch-1
Yosemite status added.
2014-10-19 20:36:03 +01:00