QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
sqlite3_database_unique_ptr Class Reference

Unique pointer for sqlite3 databases, which automatically closes the database when the pointer goes out of scope or is reset. More...

#include <qgssqliteutils.h>

Inheritance diagram for sqlite3_database_unique_ptr:
Inheritance graph
[legend]

Public Member Functions

QString errorMessage () const
 Returns the most recent error message encountered by the database.
 
int exec (const QString &sql, QString &errorMessage) const
 Executes the sql command in the database.
 
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.
 
sqlite3_statement_unique_ptr prepare (const QString &sql, int &resultCode) const
 Prepares a sql statement, returning the result.
 

Detailed Description

Unique pointer for sqlite3 databases, which automatically closes the database when the pointer goes out of scope or is reset.

Definition at line 115 of file qgssqliteutils.h.

Member Function Documentation

◆ errorMessage()

QString sqlite3_database_unique_ptr::errorMessage ( ) const

Returns the most recent error message encountered by the database.

Definition at line 95 of file qgssqliteutils.cpp.

◆ exec()

int sqlite3_database_unique_ptr::exec ( const QString &  sql,
QString &  errorMessage 
) const

Executes the sql command in the database.

Multiple sql queries can be run within one single command. Errors are reported to errorMessage. Returns SQLITE_OK in case of success or an sqlite error code.

Since
QGIS 3.6

Definition at line 110 of file qgssqliteutils.cpp.

◆ open()

int sqlite3_database_unique_ptr::open ( const QString &  path)

Opens the database at the specified file path.

Returns the sqlite error code, or SQLITE_OK if open was successful.

Definition at line 79 of file qgssqliteutils.cpp.

◆ open_v2()

int sqlite3_database_unique_ptr::open_v2 ( const QString &  path,
int  flags,
const char *  zVfs 
)

Opens the database at the specified file path.

Returns the sqlite error code, or SQLITE_OK if open was successful.

Definition at line 87 of file qgssqliteutils.cpp.

◆ prepare()

sqlite3_statement_unique_ptr sqlite3_database_unique_ptr::prepare ( const QString &  sql,
int &  resultCode 
) const

Prepares a sql statement, returning the result.

The resultCode argument will be filled with the sqlite3 result code.

Definition at line 100 of file qgssqliteutils.cpp.


The documentation for this class was generated from the following files: