19#include <QtSql/qsqldriver.h>
24#define Q_EXPORT_SQLDRIVER_SQLITE
26#define Q_EXPORT_SQLDRIVER_SQLITE Q_SQL_EXPORT
36 Q_DECLARE_PRIVATE(QSQLiteDriver)
38 friend class QSQLiteResultPrivate;
40 explicit QSQLiteDriver(QObject *parent =
nullptr);
41 explicit QSQLiteDriver(sqlite3 *connection, QObject *parent =
nullptr);
43 bool hasFeature(DriverFeature f)
const override;
44 bool open(
const QString & db,
46 const QString & password,
49 const QString & connOpts) override;
50 void close() override;
51 QSqlResult *createResult()
const override;
52 bool beginTransaction() override;
53 bool commitTransaction() override;
54 bool rollbackTransaction() override;
55 QStringList tables(QSql::TableType)
const override;
57 QSqlRecord record(
const QString& tablename)
const override;
58 QSqlIndex primaryIndex(
const QString &tablename)
const override;
59 QVariant handle()
const override;
61 QString escapeIdentifier(
const QString &identifier, IdentifierType type)
const override;
62 bool isIdentifierEscaped(
const QString &identifier, IdentifierType type)
const override;
63 QString stripDelimiters(
const QString &identifier, IdentifierType type)
const override;
65 bool subscribeToNotification(
const QString &name) override;
66 bool unsubscribeFromNotification(
const QString &name) override;
67 QStringList subscribedToNotifications()
const override;
69 void handleNotification(
const QString &tableName, qint64 rowid);
QList< QSQLiteResult * > results
QSqlIndex getTableInfo(QSqlQuery &query, const QString &tableName, bool onlyPIndex=false) const
QStringList notificationid
QList< QVariant > firstRow
bool fetchNext(QSqlCachedResult::ValueCache &values, int idx, bool initialFetch)
void initColumns(bool emptyResultset)
int size() override
Returns the size of the SELECT result, or -1 if it cannot be determined or if the query is not a SELE...
bool execBatch(bool arrayBind) override
bool reset(const QString &query) override
Sets the result to use the SQL statement query for subsequent data retrieval.
QSqlRecord record() const override
Returns the current record if the query is active; otherwise returns an empty QSqlRecord.
void virtual_hook(int id, void *data) override
QSQLiteResult(const QSQLiteDriver *db)
bool exec() override
Executes the query, returning true if successful; otherwise returns false.
bool prepare(const QString &query) override
Prepares the given query for execution; the query will normally use placeholders so that it can be ex...
QVariant lastInsertId() const override
Returns the object ID of the most recent inserted row if the database supports it.
QVariant handle() const override
Returns the low-level database handle for this result set wrapped in a QVariant or an invalid QVarian...
bool gotoNext(QSqlCachedResult::ValueCache &row, int idx) override
void detachFromResultSet() override
int numRowsAffected() override
Returns the number of rows affected by the last query executed, or -1 if it cannot be determined or i...
The QSqlField class manipulates the fields in SQL database tables and views.
#define qCWarning(category,...)
#define Q_STATIC_LOGGING_CATEGORY(name,...)
static void _q_lower(sqlite3_context *context, int argc, sqlite3_value **argv)
static void _q_upper(sqlite3_context *context, int argc, sqlite3_value **argv)
static QSqlError qMakeError(sqlite3 *access, const QString &descr, QSqlError::ErrorType type, int errorCode)
static int qGetColumnType(const QString &tpName)
static void handle_sqlite_callback(void *qobj, int aoperation, char const *adbname, char const *atablename, sqlite3_int64 arowid)
#define Q_EXPORT_SQLDRIVER_SQLITE