Don't depend on the existance of the rowid column when using the Browse
Data tab; this means falling back to the primary key if the selected
table is a 'without rowid' table.
While still not supporting these tables very well this makes them at
least readable.
Issue #31 was about some problems in the SqliteTableModel which caused
an endless loop in the Execute SQL tab when executing statements with a
LIMIT part that didn't end with a semicolon. This was fixed in 0362d615fd
but the regular expression in this commit only worked for statements
like 'SELECT * FROM t LIMIT 0,10' and didn't detect a statement like
'SELECT * FROM t LIMIT 10' where there is only one number after 'limit',
so the bug still ocurred for those commands. This is fixed by this
commit.
Remove any single line comments from the SQL queries to fix all those
problems ocurring when a query ending with such a comment is inserted
into the COUNT query.
Executing the query
SELECT * FROM table -- comment
would otherwise lead to this one being executed as well
SELECT COUNT(*) FROM (SELECT * FROM table -- comment);
This is obviously invalid SQL and therefore returns no data, sometimes
even crashing the application, even though the original statement by the
user is perfectly fine.
The code used in this commit is a bit of a workaround and should be
replaced as soon as there is a more complete SQL parser supporting SQL
comments in our grammar tools.
Closes#31.
Fix the syntax of the SQL string generated by fetchData() if there is
already a LIMIT statement at the end of the query. In this case don't
add an additional one. This fixes half of issue #31.
Don't add a "LIMIT x,y" at the end of the query in fetchData() when it
is a PRAGMA or EXPLAIN statement. This way correct SQL code is produced
and it also fixes an endless loop when the statement didn't end in a
semicolon.
Change the approach to count the total number of rows returned by an SQL
query to also support EXPLAIN and PRAGMA statements. These failed before
because you are not allowed to put them into a COUNT query. This commit
adds the code needed to count the number of rows manually when one of
these queries is executed.
Fix a bug in SqliteTableModel that caused the application to crash when
the SQL query contained a semicolon somewhere in the middle of the
string. This was caused by an error in the rtrimChar function which
returned everything left of the first semicolon. The new implementation
only removed trailing characters.
Give the user an error message when setting new data for a cell fails.
This is especially useful when the problem is caused by foreign key
constraints.
Always produce correct SQL statements, even when using an incomplete
comparison operator.
Fix escaping to make it possible to search for '-charachters.
Call beginRemoveRows() and endRemoveRows() when emptying the cache. This
silences those warnings from QAbstractItemModel::endInsertRows() and
fixes a crash when exiting the program both ocurring when the data was
resorted.
Add a row of line edits between the table header and the actual content
of the table in the browse tab. Show one input widget per table column
in this row.
Add a live search which hides any table rows which do not fit to the
current filter settings.
Why add this to the parital-data-fetch branch? Because this is an
attempt to get rid of the find dialog which is broken again and not even
worth fixing. Also there is not much to break in this branch at the
moment ;)
Change the way sorting is done to correctly sort all data even if it
hasn't been loaded completely yet.
Fix the navigation label and buttons by showing the correct information
again and fixing the validator of the input field.
Log all SQL statements executed from within the SqliteTableModel.
Silence a few warnings.
Fix empty rows being shown in the main window when changing to a table
with less rows than the old one.
Add sorting in the browse tab again.
Do some minor clean ups.