Commit Graph

1034 Commits

Author SHA1 Message Date
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
Justin Clift 0457b7803e Added 3.5.0 release to the README.md Releases line 2015-01-31 18:56:37 +01:00
Justin Clift 727f983c17 Updated currentrelease to 3.5.0 2015-01-31 18:54:40 +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
Samir Aguiar 25eb83b1a1 qmake: Copy generated translations files into app bundle
The translations were not being added to the bundle when
deploying the Mac app and thus no language other than
English could be loaded.
2015-01-27 23:03:30 +01:00
Peinthor Rene 78df7275fe windowsupdatecheck: Fix a small memory leak 2015-01-27 22:14:20 +01:00
Martin Kleusberg d6b887d4f0 Merge pull request #187 from samir-aguiar/master
Add language combobox to the Preferences menu
2015-01-25 20:38:37 +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
Justin Clift 823e51a917 Added FreeBSD pkg install info. Closes #180. 2015-01-19 16:39:30 +00:00
Martin Kleusberg a4d41be2a1 Merge pull request #185 from pinotree/tests-fix-qcoreapp
tests: fix QCoreApplication parameters
2015-01-17 14:32:17 +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
Martin Kleusberg 414f27e50a Merge pull request #181 from samir-aguiar/master
qmake: Add compatibility with shadow build
2015-01-08 22:54:55 +01:00
Samir Aguiar db7fdc2a04 qmake: Add compatibility with shadow build
See issue #175.
2015-01-07 19:15:35 +01:00
Justin Clift a1c2108913 Added link to lbartoletti text 2015-01-06 22:30:59 +00:00
Justin Clift 48b70c3d63 Added FreeBSD port info to the FreeBSD section
Thanks @lbartoletti :)
2015-01-06 22:29:03 +00: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 c868ff1f12 Merge branch 'yunfzhan-master' 2014-12-08 11:38:53 +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 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