Commit Graph

805 Commits

Author SHA1 Message Date
Martin Kleusberg
a3affde782 Make sure columns in the Execute SQL area don't get too big by default
When running a SQL statement the column widths of the result table view
are set to fit their contents automatically. However, for very long
values this makes the table hard to navigate. This is why this commit
introduces a maximum column width while still trying to fit each column
to its contents.

See issue #79, point 2.
2014-08-22 14:27:54 +02:00
Martin Kleusberg
cbc324b205 Grammar: Allow rowid as column name
This fixes #80.
2014-08-22 14:10:19 +02:00
Martin Kleusberg
51014a7ddc Grammar: Allow key as column name 2014-08-22 14:07:05 +02:00
Peinthor Rene
9aa73915c3 sqliteparsing: add a flag to indicate if we support modifying in our dlg
This flag should indicate if we can fully handle this table definition
in our edit table dialog. if not we should do one of these things:
* disable the edit table dialog to modify the table
* display a warning message that modifying this table may remove constraints
* ??
2014-08-18 19:41:49 +02:00
Peinthor Rene
aff96bf709 grammar: remove trailing WS 2014-08-18 19:17:24 +02:00
Peinthor Rene
6d47c749f8 grammar: proper support the index_column rule 2014-08-18 19:16:45 +02:00
Peinthor Rene
2cadb38719 tablemodel: if our sql parser failed get column names from sqlite
This makes browsing more robust if our sqlite parser fails
we will fallback to a sqlite query to retrieve the column names
2014-08-18 18:53:16 +02:00
Peinthor Rene
e9fc2229c2 grammar: disable antlr's default error handling
We(I) did not count on that behavior anyway and this should have never
been in place
2014-08-18 18:47:35 +02:00
Peinthor Rene
bd11193235 sqlitetypes: avoid copy of member 2014-08-18 18:40:10 +02:00
Peinthor Rene
32ef063d11 sqlite3: workaround to prevent creating 0 byte sqlite3 database files 2014-08-17 13:05:49 +02:00
Peinthor Rene
9fdc71be2c grammar: fix crash and autoincrement in primary key table_constraints 2014-08-17 12:55:22 +02:00
Martin Kleusberg
abe622ebf4 EditTableDialog: Reload the current DB schema when cancelling
All the editing in the EditTableDialog, that is the DBBrowserDB class to
be specific, messes up the current representation of the DB schema. This
is fine when the changes are actually committed by clicking the OK
button but causes confusion when the dialog is cancelled. None of the
changes are actually written to the database but the UI looks like they
are.

This closes issue #74.
2014-08-15 22:54:36 +02:00
Martin Kleusberg
b754284073 Grammar: Show antlr error message where possible
When catching an exception thrown by antlr print all the information
which has been provided.
2014-08-15 12:23:51 +02:00
Peinthor Rene
cf0213cd7e sqlitemodel: fix endless loop if offset is used in LIMIT 2014-08-13 12:11:03 +02:00
Peinthor Rene
58867aa181 edittable: update comment 2014-08-07 23:17:42 +02:00
Peinthor Rene
ff50a94eef edittable: add ability to set the unique constraint on a table 2014-08-07 23:15:38 +02:00
Peinthor Rene
f291f89a93 sqlitetypes: extract unique information of columns 2014-08-07 23:14:21 +02:00
Justin Clift
b355005b89 Update 3.0.1 version number with 999.0.0 placeholder
As suggested by Martin here: https://github.com/sqlitebrowser/sqlitebrowser/pull/71/files#r15728485
2014-08-03 12:32:11 +01:00
Martin Kleusberg
610d9071b1 Merge pull request #71 from elfring/Complete_quoting_for_parameters_of_some_CMake_commands
Complete quoting for parameters of some CMake commands.
2014-08-02 12:19:02 +02:00
Tim Brust
2e5405a60b Update BUILDING.md by specifing path for cmake
Being in the root directory cmake needed a path for the CMakeLists.txt - otherwise cmake won't run
2014-08-01 17:05:04 +01:00
Markus Elfring
d3ccdc2cdd Bug #58: Completed quoting for parameters of some CMake commands
A wiki article pointed out that whitespace will only be preserved for parameters
in CMake commands if passed strings will be appropriately quoted or escaped.
http://cmake.org/Wiki/CMake/Language_Syntax#CMake_splits_arguments_unless_you_use_quotation_marks_or_escapes.

Quoting was added so that more places should also handle file names correctly
which contain space characters or semicolons eventually.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
2014-08-01 15:49:11 +02:00
Martin Kleusberg
86797591ec Fix issue introduced in ba75bd16fe 2014-08-01 11:21:47 +02:00
Justin Clift
135349af15 Adjust the message about quote character in path on OSX 2014-07-31 21:51:48 +01:00
Martin Kleusberg
ba75bd16fe Use common format for all include guards and avoid leading underscores
Use a common format for all include guards, make sure each header file
has one and make sure it's named after the file name.

And as a random extra in this commit: Make sure the gen_version.h file
generated by cmake ends with a line break.

Closes #59.
2014-07-31 21:32:58 +02:00
Martin Kleusberg
5f4066c351 MainWindow: Show line numbers in SQL log 2014-07-31 21:19:41 +02:00
Justin Clift
ccfc3519f8 Remove trailing whitespace, accidentally added in previous commit 2014-07-31 09:15:15 +01:00
Justin Clift
e801a7867d Added steps for compiling single executable binary on OSX 2014-07-31 09:14:12 +01:00
mafagafogigante
262612928d some comments were corrected 2014-07-31 08:56:24 +01:00
Justin Clift
3b91636740 Update the internal OSX .app package number to 3.2.99 2014-07-27 21:11:54 +01:00
Peinthor Rene
8d9f08a74a qt5: fix qt5 cmake build 2014-07-27 21:06:56 +02:00
Peinthor Rene
f8b5c92c0b update windows cross compiling instructions
since translation files are generated now and mxe qt4 is missing
a lrelease binary, we have to use the system one
2014-07-27 20:46:35 +02:00
Martin Kleusberg
e43f43a3f8 Silence some warnings in the antlr code 2014-07-27 13:39:36 +02:00
Peinthor Rene
7a5c60b300 Merge pull request #66 from achpile/master
'%u' causes warning messages on 64bit systems.
2014-07-26 23:21:27 +02:00
Martin Kleusberg
373bd5db5b Remove \r characters from table definitions while reading DB layout
Remove all \r characters from a table defintion when reading it. This
makes sure it doesn't appear as a invalid character in the UI.

This commit improves the displaying of EoD's database from issue #63.
2014-07-26 21:41:12 +02:00
Martin Kleusberg
2dd0e9516f Grammar: Allow multiple table keys which are not separated by commas
Fix table definitions like this...
CREATE TABLE [player_tech_branches]
(
	[from_id] INTEGER NOT NULL REFERENCES [techs](id),
	[to_id] INTEGER NOT NULL REFERENCES [techs](id),

	UNIQUE ([from_id], [to_id]) PRIMARY KEY ([from_id], [to_id])
)
...where there are multiple keys which are not separated by commas.

This partially fixed EoD's database in issue #63.
2014-07-26 21:41:12 +02:00
Martin Kleusberg
8d23c77578 Grammar: Fix multiple primary keys with conflict clause
Fix handling of multiple primary keys followed by a conflict clause like
in thix table definition:
CREATE TABLE [explore_records]
(
	[system_id] INTEGER NOT NULL REFERENCES [star_systems](id),
	[player_id] INTEGER NOT NULL REFERENCES [players](id),
	PRIMARY KEY ([player_id], [system_id]) ON CONFLICT ABORT
)

This partially fixes EoD's problem in issue #63.
2014-07-26 21:41:12 +02:00
Martin Kleusberg
7f007824fa Grammar: Support ON INSERT in foreign key clauses
Allow ON INSERT in foreign key clauses like this:
CREATE TABLE x
(
	y INTEGER REFERENCES ref(id) ON INSERT CASCADE
)
Note that ON INSERT is allowed by SQLite but missing in the SQLite
documentation.

This partially fixes EoD's problem in issue #63.
2014-07-26 21:41:12 +02:00
Fedosov Alexander
a17fd095d1 '%u' causes warning messages on 64bit systems. 2014-07-26 18:46:40 +04:00
Justin Clift
4cafe43525 Trivial typo fix 2014-07-21 22:36:50 +01:00
Justin Clift
815dae90e2 Removed readline dependancy of SQLite on OSX
Readline isn't needed the way we use things, and it's just an unneccesary dependency
2014-07-21 22:30:07 +01:00
Martin Kleusberg
64bcc42241 Grammar: Add 'NO' identifier
See issue #56.
2014-07-21 21:24:53 +02:00
Martin Kleusberg
b921fe58f3 Fix treatment of spaces when importing CSV files without quotes
When importing a CSV file without no quote characters no spaces were
imported. So this...
a,b b,c
...would become...
a,bb,c

Fix this by not checking for being in quote mode when not having
configured a quote char anyway.
2014-07-20 18:12:46 +02:00
Martin Kleusberg
cd9a563568 i18n: Also build qm files when compiling using cmake and Qt5
Disclaimer: This is untested but looks plausible to me...
2014-07-20 17:37:31 +02:00
Martin Kleusberg
e07067e8bb Merge pull request #57 from VanDerSam/master
I18N was improved. Translation GUI to Russian was made.
2014-07-20 17:32:07 +02:00
Sergey Muratov
87bda982c1 I18N was improved. Translation GUI to Russian was made. 2014-07-15 22:33:17 +04:00
Martin Kleusberg
13464f41d3 Fix spelling. 2014-07-12 16:26:53 +02:00
Martin Kleusberg
42a2faf411 Tests: Simplify the cmake file
Now that the dependeny to the main window is removed from the
DBBrowserDB class we can get rid of all the dialogs and widget related
stuff in the cmake file used for the unit test project. Because our
Application class depends on the main window, too, the code for the CSV
tests is changed to use Qt's standard QApplication class.
2014-07-12 16:21:08 +02:00
Martin Kleusberg
17cf2018ca Remove dependency to main window from DBBrowserDB class
Get rid of the dependency to the MainWindow class in the DBBrowserDB
class. It was only used for calling the log SQL and set database state
functions anyway. The same result can be achieved emitting Qt slots.
2014-07-12 16:13:32 +02:00
Martin Kleusberg
bc705b61f1 Fix stupid spelling mistake in the default gen_version.h file
Fix a spelling error in the include guard of the default gen_version.h
file. It didn't really matter even though this exact file is used when
building with qmake because it never gets included multiple times... but
it just looked odd to me and was a bit annoying since I noticed it :)
2014-07-11 21:35:32 +02:00
Martin Kleusberg
e7924f3739 Tests: Add unit tests for CSV import
Add a new test class for testing the import functionality. Currently
it's only covers some test cases for the CSV import.

Since the function to test here (DBBrowserDB::decodeCSV) is part of the
DBBrowserDB class, that class has a reference to the main window and the
main window basically depends on the entire rest of the project the
makefile grew quite a bit unfortunately.
2014-07-11 21:31:34 +02:00