Commit Graph

706 Commits

Author SHA1 Message Date
Justin Clift
103a9a27c9 Merge pull request #198 from samir-aguiar/ui-fix
preferencesdialog: Restore ability to change default location
2015-02-06 20:34:31 +00:00
Samir Aguiar
0b6f0f45e0 preferencesdialog: Restore ability to change default location
Commit ae03113 broke the UI: the signal triggered when pressing
the button to change the default location and the tab order
had been lost.

See issue #197.
2015-02-06 19:56:16 +01:00
Martin Kleusberg
03b4ef9d1f Further improve 408fbcf8b4 2015-02-06 14:36:53 +01:00
Martin Kleusberg
408fbcf8b4 Use same data type as SQLite for primary keys
This improves commit c20c58595a to
definitely make sure the primary key values are stored and handled
correctly by simply using the same data type as SQLite itself does.
2015-02-06 14:08:59 +01:00
Martin Kleusberg
4fa0576853 Support tables with empty table names
Apparently SQLite supports empty table names for whatever reason. This
commit patches SQLiteBrowser to support databases with a table with an
empty name. I haven't removed the check for an empty table name in the
Create/Edit table dialog though because you probably really shouldn't
create such a table.

See issue #194.
2015-02-06 13:30:30 +01:00
Peinthor Rene
8d55fd5c48 cvsparse: used wrong var for last row check 2015-02-05 15:58:42 +01:00
Martin Kleusberg
c20c58595a Support 64bit primary keys
Primary keys in SQLite are 64bit in size. We, however, used the int
datatype which often is 32bit only. Also the conversion from QString and
other Qt datatypes to numbers was done by the toInt() method which fails
on these large numbers. These issues are fixed by this commit, adding
support for databases with big primary key values.

See issue #172.
2015-02-04 17:55:43 +01:00
Martin Kleusberg
f63b11925d cipher: Fix attaching unencrypted DB if main is encrypted and vice-versa
When attaching another database, SQLCipher assumes that it shares
passphrase and salt with the main database. Usually this isn't the case,
though. With this commit SQLiteBrowser tries to open the database to attach
before actually attaching it and asks for encryption details if needed.

This allows the user to attach unencrypted databases to an encrypted
master database and vice-versa. Note though, that attaching an encrypted
database with a non-default (i.e. <> 1024) cipher page size doesn't seem
to work - this however, is apparently a SQLCipher limitation.

See issue #174.
2015-02-04 17:16:13 +01:00
Peinthor Rene
d0f3de3927 addrecord: a small fix that should make add record a bit more robust 2015-01-30 19:47:36 +01:00
Peinthor Rene
78df7275fe windowsupdatecheck: Fix a small memory leak 2015-01-27 22:14:20 +01:00
Samir Aguiar
ce8f49d530 localization: Use path relative to the application executable
This allows the languages to be loaded when the user is
running the app from another directory (e.g. when the app
is run from an exported path).
2015-01-21 23:06:03 +01:00
Samir Aguiar
ae031137b3 preferencesdialog: Move default location option to General tab 2015-01-21 23:06:02 +01:00
Samir Aguiar
eb1a32ef24 localization: Rename Chinese translation file to match locale
This allows the file to be included in the language box
(Qt wasn't recognizing the "cn" suffix as a valid locale).
2015-01-21 23:06:02 +01:00
Samir Aguiar
6d6544043d preferencesdialog: New combobox to change application language
The behavior remains basically as before: when first launched
the application will try to load a translation for the user's
locale, and if one cannot be found it defaults to English.
The difference is that now this is remembered so that upon
further launches the program will go straight to the matching
locale.

See issue #182.
2015-01-21 23:06:02 +01:00
Pino Toscano
afaf2ca73c tests: fix QCoreApplication parameters
The argument count (first parameter) is a reference, and thus must be
kept alive for the whole lifetime of the QCoreApplication instance,
as also the Qt apidocs say.

Also properly create a "string array" for the actual args, instead
of badly casting a string to that.

This fixes sporadic crashes in this test.
2015-01-17 13:06:22 +01:00
Martin Kleusberg
a6bd96774a grammar: Support conflict clause in primary key constraint
Support conflict clauses (like ON CONFLICT REPLACE) inside a PRIMARY KEY
column constraint.

See https://www.sqlite.org/syntax/column-constraint.html
2015-01-16 23:35:55 +01:00
Peinthor Rene
c6f585e9c4 grammar: also allow ID tokens as default argument 2015-01-12 17:29:18 +01:00
Samir Aguiar
db7fdc2a04 qmake: Add compatibility with shadow build
See issue #175.
2015-01-07 19:15:35 +01:00
Martin Kleusberg
a090875575 tests: Add test for grammar fix in 1ea67c33d2 2015-01-06 14:12:08 +01:00
Martin Kleusberg
1ea67c33d2 grammar: Fix string literals in CHECK expressions (and maybe other places)
Fix parsing of table definitions like this one where there is a complex
check constraint using string literals:
CREATE TABLE "a" (
    `b` TEXT CHECK(`b`='A' or `b`='B')
);
The grammar parser would fail to parse this statement correctly prior to
this fix.

See issue #179.
2015-01-06 14:11:28 +01:00
Martin Kleusberg
0f4ac7e89c index: Support creating indices without sorting
See issue #176.
2014-12-26 16:20:20 +01:00
Peinthor Rene
e01307aa73 Merge pull request #168 from justinclift/os2v2
Added icon for IBM OS/2
2014-12-08 11:45:21 +01:00
Peinthor Rene
46cfc99031 browsetab: change go to begin/end button text so its more obvious begin and end is meant 2014-12-08 11:43:08 +01:00
Peinthor Rene
9ca6c5f3bb Merge branch 'master' of git://github.com/yunfzhan/sqlitebrowser into yunfzhan-master 2014-12-08 11:36:49 +01:00
Elbert Pol
5879553c5f Added icon for IBM OS/2 2014-12-05 09:20:29 +00:00
yunfzhan
71cf0531fe Add two buttons to navigate to the head and the tail. 2014-12-02 18:23:52 -08:00
Martin Kleusberg
ce41627984 Don't use deprecated pragmas
Don't call the empty_result_callback and show_datatypes pragmas when
opening or creating a database file. The first one is marked as
deprecated in the documentation [1] and the latter one doesn't appear
there at all anymore but was removed in February 2004(!) [2].

[1] https://www.sqlite.org/pragma.html#pragma_empty_result_callbacks
[2] https://www.mail-archive.com/sqlite-users@sqlite.org/msg01252.html
2014-12-02 21:15:00 +01:00
Martin Kleusberg
3ba769f393 Also get default values after adding row to table with keyword as name
Fix SELECT statement to retrieve default values after inserting a new
row into a table with a keyword as table name.
2014-12-01 18:00:13 +01:00
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
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
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