Commit 2fed425c authored by Marco Bubke's avatar Marco Bubke

Clang: Cleanup string interface of sqlite

We only will need the utf8 optimized SmallString for the indexer database.
So we remove all other string bindings, QByteArray and QVariant.

Change-Id: I4a77901a80b26bf292fc85df535c2ccf3a8ab52f
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 1727e643
......@@ -26,19 +26,22 @@
#pragma once
#include "sqliteglobal.h"
#include "utf8string.h"
#include <utils/smallstring.h>
#include <vector>
namespace Sqlite {
class ColumnDefinition
{
public:
void setName(const Utf8String &name)
void setName(Utils::SmallString &&name)
{
m_name = name;
m_name = std::move(name);
}
const Utf8String &name() const
const Utils::SmallString &name() const
{
return m_name;
}
......@@ -53,14 +56,14 @@ public:
return m_type;
}
Utf8String typeString() const
Utils::SmallString typeString() const
{
switch (m_type) {
case ColumnType::None: return Utf8String();
case ColumnType::Numeric: return Utf8StringLiteral("NUMERIC");
case ColumnType::Integer: return Utf8StringLiteral("INTEGER");
case ColumnType::Real: return Utf8StringLiteral("REAL");
case ColumnType::Text: return Utf8StringLiteral("TEXT");
case ColumnType::None: return {};
case ColumnType::Numeric: return "NUMERIC";
case ColumnType::Integer: return "INTEGER";
case ColumnType::Real: return "REAL";
case ColumnType::Text: return "TEXT";
}
Q_UNREACHABLE();
......@@ -77,9 +80,11 @@ public:
}
private:
Utf8String m_name;
Utils::SmallString m_name;
ColumnType m_type;
bool m_isPrimaryKey = false;
};
using ColumnDefinitions = std::vector<ColumnDefinition>;
} // namespace Sqlite
......@@ -25,47 +25,45 @@
#include "createtablesqlstatementbuilder.h"
#include "utf8stringvector.h"
namespace Sqlite {
CreateTableSqlStatementBuilder::CreateTableSqlStatementBuilder()
: m_sqlStatementBuilder(Utf8StringLiteral("CREATE TABLE IF NOT EXISTS $table($columnDefinitions)$withoutRowId")),
: m_sqlStatementBuilder("CREATE TABLE IF NOT EXISTS $table($columnDefinitions)$withoutRowId"),
m_useWithoutRowId(false)
{
}
void CreateTableSqlStatementBuilder::setTable(const Utf8String &tableName)
void CreateTableSqlStatementBuilder::setTable(Utils::SmallString &&tableName)
{
m_sqlStatementBuilder.clear();
this->m_tableName = tableName;
this->m_tableName = std::move(tableName);
}
void CreateTableSqlStatementBuilder::addColumnDefinition(const Utf8String &columnName,
void CreateTableSqlStatementBuilder::addColumnDefinition(Utils::SmallString &&columnName,
ColumnType columnType,
bool isPrimaryKey)
{
m_sqlStatementBuilder.clear();
ColumnDefinition columnDefinition;
columnDefinition.setName(columnName);
columnDefinition.setName(std::move(columnName));
columnDefinition.setType(columnType);
columnDefinition.setIsPrimaryKey(isPrimaryKey);
m_columnDefinitions.append(columnDefinition);
m_columnDefinitions.push_back(columnDefinition);
}
void CreateTableSqlStatementBuilder::setColumnDefinitions(const QVector<ColumnDefinition> &columnDefinitions)
void CreateTableSqlStatementBuilder::setColumnDefinitions(ColumnDefinitions &&columnDefinitions)
{
m_sqlStatementBuilder.clear();
this->m_columnDefinitions = columnDefinitions;
m_columnDefinitions = std::move(columnDefinitions);
}
void CreateTableSqlStatementBuilder::setUseWithoutRowId(bool useWithoutRowId)
{
this->m_useWithoutRowId = useWithoutRowId;
m_useWithoutRowId = useWithoutRowId;
}
void CreateTableSqlStatementBuilder::clear()
......@@ -82,7 +80,7 @@ void CreateTableSqlStatementBuilder::clearColumns()
m_columnDefinitions.clear();
}
Utf8String CreateTableSqlStatementBuilder::sqlStatement() const
Utils::SmallStringView CreateTableSqlStatementBuilder::sqlStatement() const
{
if (!m_sqlStatementBuilder.isBuild())
bindAll();
......@@ -92,35 +90,35 @@ Utf8String CreateTableSqlStatementBuilder::sqlStatement() const
bool CreateTableSqlStatementBuilder::isValid() const
{
return m_tableName.hasContent() && !m_columnDefinitions.isEmpty();
return m_tableName.hasContent() && !m_columnDefinitions.empty();
}
void CreateTableSqlStatementBuilder::bindColumnDefinitions() const
{
Utf8StringVector columnDefinitionStrings;
Utils::SmallStringVector columnDefinitionStrings;
foreach (const ColumnDefinition &columnDefinition, m_columnDefinitions) {
Utf8String columnDefinitionString = columnDefinition.name() + Utf8StringLiteral(" ") + columnDefinition.typeString();
for (const ColumnDefinition &columnDefinition : m_columnDefinitions) {
Utils::SmallString columnDefinitionString = {columnDefinition.name(), " ", columnDefinition.typeString()};
if (columnDefinition.isPrimaryKey())
columnDefinitionString.append(Utf8StringLiteral(" PRIMARY KEY"));
columnDefinitionString.append(" PRIMARY KEY");
columnDefinitionStrings.append(columnDefinitionString);
columnDefinitionStrings.push_back(columnDefinitionString);
}
m_sqlStatementBuilder.bind(Utf8StringLiteral("$columnDefinitions"), columnDefinitionStrings);
m_sqlStatementBuilder.bind("$columnDefinitions", columnDefinitionStrings);
}
void CreateTableSqlStatementBuilder::bindAll() const
{
m_sqlStatementBuilder.bind(Utf8StringLiteral("$table"), m_tableName);
m_sqlStatementBuilder.bind("$table", m_tableName.clone());
bindColumnDefinitions();
if (m_useWithoutRowId)
m_sqlStatementBuilder.bind(Utf8StringLiteral("$withoutRowId"), Utf8StringLiteral(" WITHOUT ROWID"));
m_sqlStatementBuilder.bind("$withoutRowId", " WITHOUT ROWID");
else
m_sqlStatementBuilder.bindEmptyText(Utf8StringLiteral("$withoutRowId"));
m_sqlStatementBuilder.bindEmptyText("$withoutRowId");
}
} // namespace Sqlite
......@@ -28,7 +28,7 @@
#include "columndefinition.h"
#include "sqlstatementbuilder.h"
#include <QVector>
#include <vector>
namespace Sqlite {
......@@ -37,15 +37,15 @@ class SQLITE_EXPORT CreateTableSqlStatementBuilder
public:
CreateTableSqlStatementBuilder();
void setTable(const Utf8String &m_tableName);
void addColumnDefinition(const Utf8String &columnName, ColumnType columnType, bool isPrimaryKey = false);
void setColumnDefinitions(const QVector<ColumnDefinition> & m_columnDefinitions);
void setUseWithoutRowId(bool m_useWithoutRowId);
void setTable(Utils::SmallString &&tableName);
void addColumnDefinition(Utils::SmallString &&columnName, ColumnType columnType, bool isPrimaryKey = false);
void setColumnDefinitions(ColumnDefinitions &&columnDefinitions);
void setUseWithoutRowId(bool useWithoutRowId);
void clear();
void clearColumns();
Utf8String sqlStatement() const;
Utils::SmallStringView sqlStatement() const;
bool isValid() const;
......@@ -55,8 +55,8 @@ protected:
private:
mutable SqlStatementBuilder m_sqlStatementBuilder;
Utf8String m_tableName;
QVector<ColumnDefinition> m_columnDefinitions;
Utils::SmallString m_tableName;
ColumnDefinitions m_columnDefinitions;
bool m_useWithoutRowId;
};
......
......@@ -49,12 +49,12 @@ public:
m_isPrimaryKey = false;
}
void setName(const Utf8String &newName)
void setName(Utils::SmallString &&newName)
{
m_name = newName;
}
const Utf8String &name() const
const Utils::SmallString &name() const
{
return m_name;
}
......@@ -83,7 +83,7 @@ public:
{
ColumnDefinition columnDefinition;
columnDefinition.setName(m_name);
columnDefinition.setName(m_name.clone());
columnDefinition.setType(m_type);
columnDefinition.setIsPrimaryKey(m_isPrimaryKey);
......@@ -91,7 +91,7 @@ public:
}
private:
Utf8String m_name;
Utils::SmallString m_name;
ColumnType m_type;
bool m_isPrimaryKey;
};
......
......@@ -47,9 +47,9 @@ void SqliteDatabase::open()
m_isOpen = true;
}
void SqliteDatabase::open(const QString &databaseFilePath)
void SqliteDatabase::open(Utils::PathString &&databaseFilePath)
{
setDatabaseFilePath(databaseFilePath);
setDatabaseFilePath(std::move(databaseFilePath));
open();
}
......@@ -67,20 +67,20 @@ bool SqliteDatabase::isOpen() const
void SqliteDatabase::addTable(SqliteTable *newSqliteTable)
{
newSqliteTable->setSqliteDatabase(this);
m_sqliteTables.append(newSqliteTable);
m_sqliteTables.push_back(newSqliteTable);
}
const QVector<SqliteTable *> &SqliteDatabase::tables() const
const std::vector<SqliteTable *> &SqliteDatabase::tables() const
{
return m_sqliteTables;
}
void SqliteDatabase::setDatabaseFilePath(const QString &databaseFilePath)
void SqliteDatabase::setDatabaseFilePath(Utils::PathString &&databaseFilePath)
{
m_databaseFilePath = databaseFilePath;
m_databaseFilePath = std::move(databaseFilePath);
}
const QString &SqliteDatabase::databaseFilePath() const
const Utils::PathString &SqliteDatabase::databaseFilePath() const
{
return m_databaseFilePath;
}
......
......@@ -28,8 +28,9 @@
#include "sqlitedatabasebackend.h"
#include "sqliteglobal.h"
#include <QString>
#include <QVector>
#include <utils/smallstring.h>
#include <vector>
namespace Sqlite {
......@@ -46,16 +47,16 @@ public:
~SqliteDatabase();
void open();
void open(const QString &databaseFilePath);
void open(Utils::PathString &&databaseFilePath);
void close();
bool isOpen() const;
void addTable(SqliteTable *newSqliteTable);
const QVector<SqliteTable *> &tables() const;
const std::vector<SqliteTable *> &tables() const;
void setDatabaseFilePath(const QString &databaseFilePath);
const QString &databaseFilePath() const;
void setDatabaseFilePath(Utils::PathString &&databaseFilePath);
const Utils::PathString &databaseFilePath() const;
void setJournalMode(JournalMode journalMode);
JournalMode journalMode() const;
......@@ -70,8 +71,8 @@ private:
private:
SqliteDatabaseBackend m_databaseBackend;
QVector<SqliteTable*> m_sqliteTables;
QString m_databaseFilePath;
std::vector<SqliteTable*> m_sqliteTables;
Utils::PathString m_databaseFilePath;
JournalMode m_journalMode;
bool m_isOpen = false;
};
......
......@@ -100,15 +100,14 @@ void SqliteDatabaseBackend::checkpointFullWalLog()
checkIfLogCouldBeCheckpointed(resultCode);
}
void SqliteDatabaseBackend::open(const QString &databaseFilePath)
void SqliteDatabaseBackend::open(Utils::SmallStringView databaseFilePath)
{
checkCanOpenDatabase(databaseFilePath);
QByteArray databaseUtf8Path = databaseFilePath.toUtf8();
int resultCode = sqlite3_open_v2(databaseUtf8Path.data(),
&m_databaseHandle,
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
NULL);
int resultCode = sqlite3_open_v2(databaseFilePath.data(),
&m_databaseHandle,
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
NULL);
checkDatabaseCouldBeOpened(resultCode);
......@@ -123,33 +122,33 @@ sqlite3 *SqliteDatabaseBackend::sqliteDatabaseHandle()
return m_databaseHandle;
}
void SqliteDatabaseBackend::setPragmaValue(const Utf8String &pragmaKey, const Utf8String &newPragmaValue)
void SqliteDatabaseBackend::setPragmaValue(Utils::SmallStringView pragmaKey, Utils::SmallStringView newPragmaValue)
{
SqliteReadWriteStatement statement(Utf8StringLiteral("PRAGMA ") + pragmaKey + Utf8StringLiteral("='") + newPragmaValue + Utf8StringLiteral("'"), *this);
SqliteReadWriteStatement statement(Utils::SmallString{"PRAGMA ", pragmaKey, "='", newPragmaValue, "'"}, *this);
statement.step();
Utf8String pragmeValueInDatabase = toValue<Utf8String>(Utf8StringLiteral("PRAGMA ") + pragmaKey);
Utils::SmallString pragmeValueInDatabase = toValue<Utils::SmallString>("PRAGMA " + pragmaKey);
checkPragmaValue(pragmeValueInDatabase, newPragmaValue);
}
Utf8String SqliteDatabaseBackend::pragmaValue(const Utf8String &pragma)
Utils::SmallString SqliteDatabaseBackend::pragmaValue(Utils::SmallStringView pragma)
{
return toValue<Utf8String>(Utf8StringLiteral("PRAGMA ") + pragma);
return toValue<Utils::SmallString>("PRAGMA " + pragma);
}
void SqliteDatabaseBackend::setJournalMode(JournalMode journalMode)
{
setPragmaValue(Utf8StringLiteral("journal_mode"), journalModeToPragma(journalMode));
setPragmaValue("journal_mode", journalModeToPragma(journalMode));
}
JournalMode SqliteDatabaseBackend::journalMode()
{
return pragmaToJournalMode(pragmaValue(Utf8StringLiteral("journal_mode")));
return pragmaToJournalMode(pragmaValue("journal_mode"));
}
void SqliteDatabaseBackend::setTextEncoding(TextEncoding textEncoding)
{
setPragmaValue(Utf8StringLiteral("encoding"), textEncodingToPragma(textEncoding));
setPragmaValue("encoding", textEncodingToPragma(textEncoding));
cacheTextEncoding();
}
......@@ -159,9 +158,9 @@ TextEncoding SqliteDatabaseBackend::textEncoding()
}
Utf8StringVector SqliteDatabaseBackend::columnNames(const Utf8String &tableName)
Utils::SmallStringVector SqliteDatabaseBackend::columnNames(Utils::SmallStringView tableName)
{
SqliteReadWriteStatement statement(Utf8StringLiteral("SELECT * FROM ") + tableName, *this);
SqliteReadWriteStatement statement("SELECT * FROM " + tableName, *this);
return statement.columnNames();
}
......@@ -175,9 +174,9 @@ int SqliteDatabaseBackend::totalChangesCount()
return sqlite3_total_changes(sqliteDatabaseHandle());
}
void SqliteDatabaseBackend::execute(const Utf8String &sqlStatementUtf8)
void SqliteDatabaseBackend::execute(Utils::SmallStringView sqlStatement)
{
SqliteReadWriteStatement statement(sqlStatementUtf8, *this);
SqliteReadWriteStatement statement(sqlStatement, *this);
statement.step();
}
......@@ -233,7 +232,7 @@ int SqliteDatabaseBackend::busyHandlerCallback(void *, int counter)
void SqliteDatabaseBackend::cacheTextEncoding()
{
m_cachedTextEncoding = pragmaToTextEncoding(pragmaValue(Utf8StringLiteral("encoding")));
m_cachedTextEncoding = pragmaToTextEncoding(pragmaValue("encoding"));
}
void SqliteDatabaseBackend::checkForOpenDatabaseWhichCanBeClosed()
......@@ -250,7 +249,7 @@ void SqliteDatabaseBackend::checkDatabaseClosing(int resultCode)
}
}
void SqliteDatabaseBackend::checkCanOpenDatabase(const QString &databaseFilePath)
void SqliteDatabaseBackend::checkCanOpenDatabase(Utils::SmallStringView databaseFilePath)
{
if (databaseFilePath.isEmpty())
throw SqliteException("SqliteDatabaseBackend::SqliteDatabaseBackend: database cannot be opened:", "database file path is empty!");
......@@ -270,7 +269,8 @@ void SqliteDatabaseBackend::checkDatabaseCouldBeOpened(int resultCode)
}
}
void SqliteDatabaseBackend::checkPragmaValue(const Utf8String &databaseValue, const Utf8String &expectedValue)
void SqliteDatabaseBackend::checkPragmaValue(Utils::SmallStringView databaseValue,
Utils::SmallStringView expectedValue)
{
if (databaseValue != expectedValue)
throwException("SqliteDatabaseBackend::setPragmaValue: pragma value is not set!");
......@@ -318,33 +318,35 @@ void SqliteDatabaseBackend::checkIfLogCouldBeCheckpointed(int resultCode)
throwException("SqliteDatabaseBackend::checkpointFullWalLog: WAL log could not be checkpointed!");
}
int SqliteDatabaseBackend::indexOfPragma(const Utf8String pragma, const Utf8String pragmas[], size_t pragmaCount)
namespace {
template<std::size_t Size>
int indexOfPragma(Utils::SmallStringView pragma, const Utils::SmallStringView (&pragmas)[Size])
{
for (unsigned int index = 0; index < pragmaCount; index++) {
for (unsigned int index = 0; index < Size; index++) {
if (pragma == pragmas[index])
return int(index);
}
return -1;
}
}
static const Utf8String journalModeStrings[] = {
Utf8StringLiteral("delete"),
Utf8StringLiteral("truncate"),
Utf8StringLiteral("persist"),
Utf8StringLiteral("memory"),
Utf8StringLiteral("wal")
constexpr const Utils::SmallStringView journalModeStrings[] = {
"delete",
"truncate",
"persist",
"memory",
"wal"
};
const Utf8String &SqliteDatabaseBackend::journalModeToPragma(JournalMode journalMode)
Utils::SmallStringView SqliteDatabaseBackend::journalModeToPragma(JournalMode journalMode)
{
return journalModeStrings[int(journalMode)];
}
JournalMode SqliteDatabaseBackend::pragmaToJournalMode(const Utf8String &pragma)
JournalMode SqliteDatabaseBackend::pragmaToJournalMode(Utils::SmallStringView pragma)
{
int index = indexOfPragma(pragma, journalModeStrings, SIZE_OF_BYTEARRAY_ARRAY(journalModeStrings));
int index = indexOfPragma(pragma, journalModeStrings);
if (index < 0)
throwExceptionStatic("SqliteDatabaseBackend::pragmaToJournalMode: pragma can't be transformed in a journal mode enumeration!");
......@@ -352,20 +354,20 @@ JournalMode SqliteDatabaseBackend::pragmaToJournalMode(const Utf8String &pragma)
return static_cast<JournalMode>(index);
}
static const Utf8String textEncodingStrings[] = {
Utf8StringLiteral("UTF-8"),
Utf8StringLiteral("UTF-16le"),
Utf8StringLiteral("UTF-16be")
constexpr const Utils::SmallStringView textEncodingStrings[] = {
"UTF-8",
"UTF-16le",
"UTF-16be"
};
const Utf8String &SqliteDatabaseBackend::textEncodingToPragma(TextEncoding textEncoding)
Utils::SmallStringView SqliteDatabaseBackend::textEncodingToPragma(TextEncoding textEncoding)
{
return textEncodingStrings[textEncoding];
}
TextEncoding SqliteDatabaseBackend::pragmaToTextEncoding(const Utf8String &pragma)
TextEncoding SqliteDatabaseBackend::pragmaToTextEncoding(Utils::SmallStringView pragma)
{
int index = indexOfPragma(pragma, textEncodingStrings, SIZE_OF_BYTEARRAY_ARRAY(textEncodingStrings));
int index = indexOfPragma(pragma, textEncodingStrings);
if (index < 0)
throwExceptionStatic("SqliteDatabaseBackend::pragmaToTextEncoding: pragma can't be transformed in a text encoding enumeration!");
......@@ -387,9 +389,9 @@ void SqliteDatabaseBackend::throwException(const char *whatHasHappens) const
}
template <typename Type>
Type SqliteDatabaseBackend::toValue(const Utf8String &sqlStatementUtf8)
Type SqliteDatabaseBackend::toValue(Utils::SmallStringView sqlStatement)
{
SqliteReadWriteStatement statement(sqlStatementUtf8, *this);
SqliteReadWriteStatement statement(sqlStatement, *this);
statement.next();
......
......@@ -27,9 +27,7 @@
#include "sqliteglobal.h"
#include "utf8stringvector.h"
#include <QStringList>
#include <utils/smallstringvector.h>
struct sqlite3;
......@@ -49,7 +47,7 @@ public:
void shutdownSqliteLibrary();
void checkpointFullWalLog();
void open(const QString &databaseFilePath);
void open(Utils::SmallStringView databaseFilePath);
void close();
void closeWithoutException();
......@@ -63,21 +61,21 @@ public:
Utf8StringVector columnNames(const Utf8String &tableName);
Utils::SmallStringVector columnNames(Utils::SmallStringView tableName);
int changesCount();
int totalChangesCount();
void execute(const Utf8String &sqlStatementUtf8);
void execute(Utils::SmallStringView sqlStatement);
template <typename Type>
Type toValue(const Utf8String &sqlStatementUtf8);
Type toValue(Utils::SmallStringView sqlStatement);
protected:
bool databaseIsOpen() const;
void setPragmaValue(const Utf8String &pragma, const Utf8String &value);
Utf8String pragmaValue(const Utf8String &pragma);
void setPragmaValue(Utils::SmallStringView pragma, Utils::SmallStringView value);
Utils::SmallString pragmaValue(Utils::SmallStringView pragma);
void registerBusyHandler();
void registerRankingFunction();
......@@ -87,9 +85,9 @@ protected:
void checkForOpenDatabaseWhichCanBeClosed();
void checkDatabaseClosing(int resultCode);
void checkCanOpenDatabase(const QString &databaseFilePath);
void checkCanOpenDatabase(Utils::SmallStringView databaseFilePath);
void checkDatabaseCouldBeOpened(int resultCode);
void checkPragmaValue(const Utf8String &databaseValue, const Utf8String &expectedValue);
void checkPragmaValue(Utils::SmallStringView databaseValue, Utils::SmallStringView expectedValue);
void checkDatabaseHandleIsNotNull();
void checkIfMultithreadingIsActivated(int resultCode);
void checkIfLoogingIsActivated(int resultCode);
......@@ -98,11 +96,10 @@ protected:
void checkShutdownSqliteLibraryWasSuccesful(int resultCode);
void checkIfLogCouldBeCheckpointed(int resultCode);
static int indexOfPragma(const Utf8String pragma, const Utf8String pragmas[], size_t pragmaCount);
static const Utf8String &journalModeToPragma(JournalMode journalMode);
static JournalMode pragmaToJournalMode(const Utf8String &pragma);
const Utf8String &textEncodingToPragma(TextEncoding textEncoding);
static TextEncoding pragmaToTextEncoding(const Utf8String &pragma);
static Utils::SmallStringView journalModeToPragma(JournalMode journalMode);
static JournalMode pragmaToJournalMode(Utils::SmallStringView pragma);
Utils::SmallStringView textEncodingToPragma(TextEncoding textEncoding);
static TextEncoding pragmaToTextEncoding(Utils::SmallStringView pragma);
Q_NORETURN static void throwExceptionStatic(const char *whatHasHappens);
Q_NORETURN void throwException(const char *whatHasHappens) const;
......
......@@ -28,5 +28,4 @@
namespace Sqlite {
}
......@@ -25,6 +25,8 @@
#pragma once
#include <utils/smallstringfwd.h>
#include <QtGlobal>
#if defined(BUILD_SQLITE_LIBRARY)
......@@ -35,11 +37,6 @@
# define SQLITE_EXPORT Q_DECL_IMPORT
#endif
namespace Sqlite {
SQLITE_EXPORT void registerTypes();
}
enum class ColumnType {
Numeric,
Integer,
......@@ -71,17 +68,3 @@ enum TextEncoding {
#endif
};
QT_BEGIN_NAMESPACE
template <typename T> class QVector;
template <typename T> class QSet;
template <class Key, class T> class QHash;
template <class Key, class T> class QMap;
class QVariant;
QT_END_NAMESPACE
class Utf8String;
class Utf8StringVector;
typedef QMap<Utf8String, QVariant> RowDictionary;
typedef QVector<RowDictionary> RowDictionaries;
......@@ -29,9 +29,9 @@
namespace Sqlite {
SqliteReadStatement::SqliteReadStatement(const Utf8String &sqlStatementUtf8,
SqliteReadStatement::SqliteReadStatement(Utils::SmallStringView sqlStatement,
SqliteDatabase &database)
: SqliteStatement(sqlStatementUtf8, database)
: SqliteStatement(sqlStatement, database)
{
checkIsReadOnlyStatement();
}
......
......@@ -32,14 +32,13 @@ namespace Sqlite {
class SQLITE_EXPORT SqliteReadStatement final : private SqliteStatement
{
public:
explicit SqliteReadStatement(const Utf8String &sqlStatementUtf8, SqliteDatabase &database);
explicit SqliteReadStatement(Utils::SmallStringView sqlStatement, SqliteDatabase &database);
using SqliteStatement::next;
using SqliteStatement::reset;
using SqliteStatement::value;
using SqliteStatement::text;
using SqliteStatement::values;
using SqliteStatement::rowColumnValueMap;
using SqliteStatement::twoColumnValueMap;
using SqliteStatement::columnCount;
using SqliteStatement::columnNames;
using SqliteStatement::bind;
......
......@@ -27,15 +27,15 @@
namespace Sqlite {
SqliteReadWriteStatement::SqliteReadWriteStatement(const Utf8String &sqlStatementUft8,
SqliteReadWriteStatement::SqliteReadWriteStatement(Utils::SmallStringView sqlStatement,
SqliteDatabase &database)
: SqliteStatement(sqlStatementUft8, database)
: SqliteStatement(sqlStatement, database)
{
}
SqliteReadWriteStatement::SqliteReadWriteStatement(const Utf8String &sqlStatementUft8,
SqliteReadWriteStatement::SqliteReadWriteStatement(Utils::SmallStringView sqlStatement,
SqliteDatabaseBackend &backend)
: SqliteStatement(sqlStatementUft8, backend)
: SqliteStatement(sqlStatement, backend)
{
}
......
......@@ -34,7 +34,7 @@ class SQLITE_EXPORT SqliteReadWriteStatement final : private SqliteStatement
friend class SqliteDatabaseBackend;
public: