24 sqlite3_close_v2( database );
29 sqlite3_finalize( statement );
34 return sqlite3_step(
get() );
39 return QString::fromUtf8( static_cast<const char *>( sqlite3_column_name(
get(), column ) ) );
44 return sqlite3_column_double(
get(), column );
49 return sqlite3_column_count(
get() );
54 return QString::fromUtf8( reinterpret_cast<const char *>( sqlite3_column_text(
get(), column ) ) );
59 return sqlite3_column_int64(
get(), column );
65 int result = sqlite3_open( path.toUtf8(), &database );
73 int result = sqlite3_open_v2( path.toUtf8(), &database, flags, zVfs );
80 return QString( sqlite3_errmsg(
get() ) );
85 sqlite3_stmt *preparedStatement =
nullptr;
86 const char *tail =
nullptr;
87 resultCode = sqlite3_prepare(
get(), sql.toUtf8(), sql.toUtf8().length(), &preparedStatement, &tail );
89 s.reset( preparedStatement );
void operator()(sqlite3_stmt *statement)
Finalizes an sqlite3 statement.
Unique pointer for sqlite3 prepared statements, which automatically finalizes the statement when the ...
QString errorMessage() const
Returns the most recent error message encountered by the database.
int step()
Steps to the next record in the statement, returning the sqlite3 result code.
int columnCount() const
Get the number of columns that this statement returns.
QString columnAsText(int column) const
Returns the column value from the current statement row as a string.
sqlite3_statement_unique_ptr prepare(const QString &sql, int &resultCode) const
Prepares a sql statement, returning the result.
int open(const QString &path)
Opens the database at the specified file path.
int open_v2(const QString &path, int flags, const char *zVfs)
Opens the database at the specified file path.
void operator()(sqlite3 *database)
Closes an sqlite database.
QString columnName(int column) const
Returns the name of column.
double columnAsDouble(int column) const
Get column value from the current statement row as a double.
qlonglong columnAsInt64(int column) const
Get column value from the current statement row as a long long integer (64 bits). ...