Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qsql_sqlite.cpp File Reference
#include "qsql_sqlite_p.h"
#include <qcoreapplication.h>
#include <qdatetime.h>
#include <qdebug.h>
#include <qlist.h>
#include <qsqlerror.h>
#include <qsqlfield.h>
#include <qsqlindex.h>
#include <qsqlquery.h>
#include <QtSql/private/qsqlcachedresult_p.h>
#include <QtSql/private/qsqldriver_p.h>
#include <qstringlist.h>
#include <qvariant.h>
#include <QScopedValueRollback>
#include <unistd.h>
#include <sqlite3.h>
#include <functional>
#include "moc_qsql_sqlite_p.cpp"
+ Include dependency graph for qsql_sqlite.cpp:

Go to the source code of this file.

Classes

class  QSQLiteResult
 
class  QSQLiteDriverPrivate
 
class  QSQLiteResultPrivate
 

Functions

static QString _q_escapeIdentifier (const QString &identifier, QSqlDriver::IdentifierType type)
 
static int qGetColumnType (const QString &tpName)
 
static QSqlError qMakeError (sqlite3 *access, const QString &descr, QSqlError::ErrorType type, int errorCode)
 
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 QSqlIndex qGetTableInfo (QSqlQuery &q, const QString &tableName, bool onlyPIndex=false)
 
static void handle_sqlite_callback (void *qobj, int aoperation, char const *adbname, char const *atablename, sqlite3_int64 arowid)
 

Function Documentation

◆ _q_escapeIdentifier()

static QString _q_escapeIdentifier ( const QString identifier,
QSqlDriver::IdentifierType  type 
)
static

Definition at line 43 of file qsql_sqlite.cpp.

References QString::contains(), QString::endsWith(), QString::isEmpty(), QString::startsWith(), and QSqlDriver::TableName.

Referenced by QSQLiteDriver::escapeIdentifier(), and qGetTableInfo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _q_lower()

static void _q_lower ( sqlite3_context *  context,
int  argc,
sqlite3_value **  argv 
)
static

Definition at line 628 of file qsql_sqlite.cpp.

References ba, context, QByteArray::data(), QString::fromUtf8(), Q_UNLIKELY, QByteArray::size(), QString::toLower(), and QString::toUtf8().

Referenced by QSQLiteDriver::open().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _q_upper()

static void _q_upper ( sqlite3_context *  context,
int  argc,
sqlite3_value **  argv 
)
static

Definition at line 640 of file qsql_sqlite.cpp.

References ba, context, QByteArray::data(), QString::fromUtf8(), Q_UNLIKELY, QByteArray::size(), QString::toUpper(), and QString::toUtf8().

Referenced by QSQLiteDriver::open().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handle_sqlite_callback()

static void handle_sqlite_callback ( void qobj,
int  aoperation,
char const *  adbname,
char const *  atablename,
sqlite3_int64  arowid 
)
static

Definition at line 1002 of file qsql_sqlite.cpp.

References QString::fromUtf8(), QMetaObject::invokeMethod(), Q_ARG, Q_UNUSED, and Qt::QueuedConnection.

Referenced by QSQLiteDriver::subscribeToNotification().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qGetColumnType()

static int qGetColumnType ( const QString tpName)
static

Definition at line 59 of file qsql_sqlite.cpp.

References QString::toLower(), and typeName.

Referenced by QSQLiteResultPrivate::initColumns(), and qGetTableInfo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qGetTableInfo()

static QSqlIndex qGetTableInfo ( QSqlQuery q,
const QString tableName,
bool  onlyPIndex = false 
)
static

Definition at line 916 of file qsql_sqlite.cpp.

References _q_escapeIdentifier(), QSqlIndex::append(), QString::at(), QString::indexOf(), QString::isEmpty(), QString::lastIndexOf(), QString::left(), QString::mid(), qGetColumnType(), QSqlField::setAutoValue(), QSqlField::setDefaultValue(), QSqlField::setRequired(), QString::size(), QSqlDriver::TableName, QVariant::toInt(), typeName, and QSqlRecord::value().

Referenced by QSQLiteDriver::primaryIndex(), and QSQLiteDriver::record().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qMakeError()

static QSqlError qMakeError ( sqlite3 *  access,
const QString descr,
QSqlError::ErrorType  type,
int  errorCode 
)
static

Definition at line 77 of file qsql_sqlite.cpp.

References QString::number().

Referenced by QSQLiteResult::exec(), QSQLiteResultPrivate::fetchNext(), and QSQLiteResult::prepare().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: