Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qsql_sqlite_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QSQL_SQLITE_H
6#define QSQL_SQLITE_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtSql/qsqldriver.h>
20
21struct sqlite3;
22
23#ifdef QT_PLUGIN
24#define Q_EXPORT_SQLDRIVER_SQLITE
25#else
26#define Q_EXPORT_SQLDRIVER_SQLITE Q_SQL_EXPORT
27#endif
28
29QT_BEGIN_NAMESPACE
30
31class QSqlResult;
33
35{
36 Q_DECLARE_PRIVATE(QSQLiteDriver)
37 Q_OBJECT
38 friend class QSQLiteResultPrivate;
39public:
40 explicit QSQLiteDriver(QObject *parent = nullptr);
41 explicit QSQLiteDriver(sqlite3 *connection, QObject *parent = nullptr);
42 ~QSQLiteDriver();
43 bool hasFeature(DriverFeature f) const override;
44 bool open(const QString & db,
45 const QString & user,
46 const QString & password,
47 const QString & host,
48 int port,
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;
56
57 QSqlRecord record(const QString& tablename) const override;
58 QSqlIndex primaryIndex(const QString &tablename) const override;
59 QVariant handle() const override;
60
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;
64
65 bool subscribeToNotification(const QString &name) override;
66 bool unsubscribeFromNotification(const QString &name) override;
67 QStringList subscribedToNotifications() const override;
68private Q_SLOTS:
69 void handleNotification(const QString &tableName, qint64 rowid);
70};
71
72QT_END_NAMESPACE
73
74#endif // QSQL_SQLITE_H
Definition qlist.h:80
QList< QSQLiteResult * > results
QSqlIndex getTableInfo(QSqlQuery &query, const QString &tableName, bool onlyPIndex=false) const
QStringList notificationid
sqlite3_stmt * stmt
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.
Definition qsqlfield.h:20
#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