Sqlite: Cleanup Sqlite

We don't need the threading anymore, so we removed it. The indexer
will be run in its thread anyway, so an extra thread makes the code
only more complicated. And we added namespaces.

Change-Id: Ibcba306324763285cf653c28bb08122345e5f8da
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Bubke
2017-07-26 16:02:24 +02:00
parent 94ba1b8b5d
commit 3dcce060b2
50 changed files with 461 additions and 1196 deletions

View File

@@ -40,12 +40,14 @@
struct sqlite3_stmt;
struct sqlite3;
namespace Sqlite {
class SQLITE_EXPORT SqliteStatement
{
protected:
explicit SqliteStatement(const Utf8String &sqlStatementUtf8);
static void deleteCompiledStatement(sqlite3_stmt *compiledStatement);
static void deleteCompiledStatement(sqlite3_stmt *m_compiledStatement);
bool next() const;
void step() const;
@@ -120,9 +122,11 @@ protected:
QString columnName(int column) const;
private:
std::unique_ptr<sqlite3_stmt, void (*)(sqlite3_stmt*)> compiledStatement;
Utf8StringVector bindingColumnNames_;
int bindingParameterCount;
int columnCount_;
mutable bool isReadyToFetchValues;
std::unique_ptr<sqlite3_stmt, void (*)(sqlite3_stmt*)> m_compiledStatement;
Utf8StringVector m_bindingColumnNames;
int m_bindingParameterCount;
int m_columnCount;
mutable bool m_isReadyToFetchValues;
};
} // namespace Sqlite