QGIS API Documentation
3.0.2-Girona (307d082)
|
Unique pointer for spatialite databases, which automatically closes the database when the pointer goes out of scope or is reset. More...
#include <qgsspatialiteutils.h>
Public Member Functions | |
QString | errorMessage () const |
Returns the most recent error message encountered by the database. More... | |
int | open (const QString &path) |
Opens the database at the specified file path. More... | |
int | open_v2 (const QString &path, int flags, const char *zVfs) |
Opens the database at the specified file path. More... | |
sqlite3_statement_unique_ptr | prepare (const QString &sql, int &resultCode) |
Prepares a sql statement, returning the result. More... | |
void | reset () |
Will close the connection and set the internal pointer to nullptr. More... | |
void | reset (sqlite3 *handle)=delete |
It is not allowed to set an arbitrary sqlite3 handle on this object. More... | |
Unique pointer for spatialite databases, which automatically closes the database when the pointer goes out of scope or is reset.
Definition at line 56 of file qgsspatialiteutils.h.
QString spatialite_database_unique_ptr::errorMessage | ( | ) | const |
Returns the most recent error message encountered by the database.
Definition at line 60 of file qgsspatialiteutils.cpp.
int spatialite_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 25 of file qgsspatialiteutils.cpp.
int spatialite_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 45 of file qgsspatialiteutils.cpp.
sqlite3_statement_unique_ptr spatialite_database_unique_ptr::prepare | ( | const QString & | sql, |
int & | resultCode | ||
) |
Prepares a sql statement, returning the result.
The resultCode argument will be filled with the sqlite3 result code.
Definition at line 65 of file qgsspatialiteutils.cpp.
void spatialite_database_unique_ptr::reset | ( | ) |
Will close the connection and set the internal pointer to nullptr.
Definition at line 40 of file qgsspatialiteutils.cpp.
|
delete |
It is not allowed to set an arbitrary sqlite3 handle on this object.
A dedicated spatialite context (connection) is created when calling open or open_v2. This context needs to be kept together with the handle, hence it is not allowed to reset to a handle with missing context.