Commit Graph

665 Commits

Author SHA1 Message Date
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
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
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
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
Martin Kleusberg
722bf3797f i18n: Add Chinese translation to project files 2014-10-29 19:46:29 +01:00
efreeking
d3d7bd767f I18N - Simplified Chinese 2014-10-27 09:17:25 +08:00
Peinthor Rene
8c5dfbb977 sqlexport: rewrite "to sql file" export to use streaming 2014-10-23 20:56:09 +02:00
Martin Kleusberg
9207e46a5e Add option to remove all line breaks in the DB Schema view
Add an option to the preferences dialog (by default disabled) which,
when activated, removes all line breaks from the Schema column in the
Database Structure tab and the DB Schema pane. Especially if there are
many tables this might make things clearer.
2014-10-17 15:37:22 +02:00
Martin Kleusberg
7b6bee11e5 Show more information on the fields of a table in the DB Structure view
In the Database Structure tab of the main window and the DB Schema
pane, show more information in the field nodes of the tree view. This
commit puts the field definition in the Schema column which has been
unsused until now. It also changes the icon of the field row when the
field is a primary key. This hopefully makes the Schema view a bit more
useful, especially in the pane.
2014-10-17 15:24:13 +02:00
Peinthor Rene
9304b4013f edittabledlg: missed to remove another textchangeevent 2014-10-17 13:54:18 +02:00
Martin Kleusberg
05c8a153ba EditTableDialog: Make it possible again to delete default value
Commit c29702a1b9 fixed the handling of
default values and added a check to enforce quote characters when they
are needed. This check wasn't prepare for empty default values (i.e. no
default value) and would add quote characters in this case, too. This is
fixed by this commit.

See issue #133.
2014-10-16 16:38:10 +02:00
Martin Kleusberg
280d5c1773 plot: Use default location from preferences dialog when saving picture 2014-10-15 19:53:06 +02:00
Martin Kleusberg
19baeb2a7a grammar: Fix double quote characters as used for escaping one
SQL allows you to use two quote characters instead of just one in order
to escape them. Example: ['aa''bb'] is read as [aa'bb]. Add detection
for these doubled quote characters to our grammar parser.

See issue #128.
2014-10-15 19:29:19 +02:00
Martin Kleusberg
a0f22a1ddb SqlExecutionArea: Use log font size for execution result
Use the same configurable font size as for the SQL log pane for the
result view of the SQL execution area tabs in the main window.

See issue #131.
2014-10-15 18:46:20 +02:00
Martin Kleusberg
5d20d97e24 MainWindow: Improve saving of project files
When saving a project file make sure it's got the right file ending.
Also add it to the list of recently opened files.

Use the default location from the preferences dialog for initialising
the file dialogs for loading and saving project files.
2014-10-15 13:44:52 +02:00
Martin Kleusberg
ff5cf3e63d MainWindow: Add project files to list of recently opened files
When opening a project file add it to the list of recently opened files
instead of the database file associated with it.
2014-10-15 13:38:32 +02:00
Martin Kleusberg
b841025bae tests: Add test to check escaping quotes by using two of them 2014-10-15 12:57:37 +02:00
Martin Kleusberg
c29702a1b9 EditTableDialog: Fix handling of default values
Fix the handling of default values in the Edit Table dialog by doing two
things: First, change the sqlb::Field class so that it doesn't put quotes
around any default values no matter what. This breaks for example NULL
default values but also causes invalid syntax if the default value is
already in quotes. Secondly, change the Edit Table dialog itself to
double check if the user should've put quotes around their default value
but hasn't. In this case add them automatically.

See issues #64 and #126.
2014-10-15 12:45:43 +02:00
Martin Kleusberg
63eaf01988 MainWindow: Automatically resize Schema column in DB Structure tab
Automatically resize the Schema column in the Database Structure tab of
the main window to fit its contents.

See issue #113.
2014-10-12 17:46:50 +02:00
Martin Kleusberg
eb8e801b57 Make it possible to jump between filters by pressing the tab key
Allow jumping between the filter input fields by pressing Tab and
Shift+Tab.

See issue #106.
2014-10-11 15:45:30 +02:00
Peinthor Rene
017715510f edittabledlg: don't react on textchanged
On every text change in the type combobox a renamecolumn was triggered
2014-10-10 18:47:04 +02:00
Peinthor Rene
f38c3f13ca csvexport: produce more rfc4180 complaint csv files 2014-10-06 20:59:09 +02:00
Peinthor Rene
62d72e6a9e csvexport: use CRLF as specified in RFC4180 2014-10-06 20:40:26 +02:00
Martin Kleusberg
ae199112a5 MainWindow: Make sure the filters are applied before getting the row num
First apply the new filter values and only when that is done get the
number of rows in the current view. This fixes the issue that, when
changing a filter, the number of rows shown under the table view is that
of the last results, not the current.

See issue #122.
2014-10-06 15:23:55 +02:00
Peinthor Rene
50731cd730 csvexport: streaming export to csv 2014-10-03 22:15:20 +02:00
Peinthor Rene
5713bc9a07 edittabledlg: allow custom types to be entered
also changed the default key shortcut to CTRL+ENTER
2014-09-27 09:51:20 +02:00
Justin Clift
6195896a6f Merge pull request #101 from justinclift/renamev2
Renamed project to "DB Browser for SQLite"
2014-09-23 00:01:54 +01:00
Peinthor Rene
594ea38420 Fix insert on integer PK fields with not null
Moved the emptyinsertstmt into DBBrowserDB class
to be able to query the database for values.
2014-09-21 20:45:12 +02:00
Justin Clift
05207b0b9f Renamed project to "DB Browser for SQLite" 2014-09-21 11:14:39 +01:00
Peinthor Rene
c615e9ac46 filters: add missing file commit for 57d086fbf2 2014-09-19 20:54:12 +02:00
Peinthor Rene
57d086fbf2 filters: don't clear filters on refresh 2014-09-19 18:27:40 +02:00
Peinthor Rene
0031c0723f tests: fix tests to run without x server 2014-09-18 08:05:45 +02:00
Peinthor Rene
98ab683662 tests: fix tests to run without x server 2014-09-18 08:01:04 +02:00
Martin Kleusberg
847ad46424 Enable version check for MacOS X 2014-09-16 20:04:46 +02:00