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.
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
* ??
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 :)
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.