KDb
KDbConnection.cpp
48 * 2: (Kexi 2.5.0) Added maxLengthIsDefault property (type: bool, if true, KDbField::maxLengthStrategy() == KDbField::DefaultMaxLength)
175KDbConnectionPrivate::KDbConnectionPrivate(KDbConnection* const conn, KDbDriver *drv, const KDbConnectionData& _connData,
224 t_objects->addField(new KDbField(QLatin1String("o_type"), KDbField::Byte, {}, KDbField::Unsigned));
232 KDbInternalTableSchema *t_objectdata = new KDbInternalTableSchema(QLatin1String("kexi__objectdata"));
241 t_fields->addField(new KDbField(QLatin1String("t_id"), KDbField::Integer, {}, KDbField::Unsigned));
242 t_fields->addField(new KDbField(QLatin1String("f_type"), KDbField::Byte, {}, KDbField::Unsigned));
431void KDbConnectionPrivate::insertFieldsExpanded(const KDbQuerySchema *query, KDbQuerySchemaFieldsExpanded *cache)
707 tr("Could not create database \"%1\". This name is reserved for system database.").arg(dbName));
743 m_result = KDbResult(tr("Database \"%1\" has been created but could not be opened.").arg(dbName));
787bool KDbConnection::useDatabase(const QString &dbName, bool kexiCompatible, bool *cancelled, KDbMessageHandler* msgHandler)
832 if (kexiCompatible && my_dbName.compare(anyAvailableDatabaseName(), Qt::CaseInsensitive) != 0) {
899 if (d->driver->behavior()->USE_TEMPORARY_DATABASE_FOR_CONNECTION_IF_NEEDED && !isDatabaseUsed()) {
997 const bool success = queryStringListInternal(&sql, &list, nullptr, nullptr, 0, KDb::isIdentifier);
1119QSharedPointer<KDbSqlResult> KDbConnection::insertRecordInternal(const QString &tableSchemaName,
1163 C_INS_REC( C_A(0) C_A(1) C_A(2) C_A(3) C_A(4) C_A(5), V_A0 V_A(1) V_A(2) V_A(3) V_A(4) V_A(5) ) \
1164 C_INS_REC( C_A(0) C_A(1) C_A(2) C_A(3) C_A(4) C_A(5) C_A(6), V_A0 V_A(1) V_A(2) V_A(3) V_A(4) V_A(5) V_A(6) ) \
1165 C_INS_REC( C_A(0) C_A(1) C_A(2) C_A(3) C_A(4) C_A(5) C_A(6) C_A(7), V_A0 V_A(1) V_A(2) V_A(3) V_A(4) V_A(5) V_A(6) V_A(7) )
1184 QString tableName((it.hasNext() && it.peekNext()->table()) ? it.next()->table()->name() : QLatin1String("??")); \
1293 m_result.setMessage(QString()); //clear as this could be most probably just "Unknown error" string.
1305 for (KDbField::ListIterator it(fieldlist.fieldsIterator()); it != fieldlist.fieldsIteratorConstEnd(); ++it) {
1344 const KDbField::Type type = f->type(); // cache: evaluating type of expressions can be expensive
1519KDbTableSchema *KDbConnection::copyTable(const KDbTableSchema &tableSchema, const KDbObject &newData)
1534 CreateTableOptions(CreateTableOption::Default) & ~CreateTableOptions(CreateTableOption::DropDestination)))
1641 if (!ts || !KDb::deleteRecords(this, *ts, QLatin1String("t_id"), tableSchema->id())) //field entries
1726 const int origID = destTableExists ? tableToReplace->id() : -1; //will be reused in the new table
1946 KDbConnection::tr("Transactions are not supported for \"%1\" driver.").arg( d->driver->metaData()->name() )); }
2202 kdbWarning() << "Aborting, object data should have at least 5 elements, found" << data.count();
2235 if (true != querySingleRecord(KDbEscapedString("SELECT o_id, o_type, o_name, o_caption, o_desc "
2329QString KDbConnection::escapeIdentifier(const QString& id, KDb::IdentifierEscapingType escapingType) const
2353tristate KDbConnection::querySingleRecordInternal(KDbRecordData *data, const KDbEscapedString *sql,
2439tristate KDbConnection::querySingleString(const KDbEscapedString &sql, QString *value, int column,
2618 QDomElement* extendedTableSchemaMainEl, const QString& fieldName, QDomElement* extendedTableSchemaFieldEl,
2648 QDomElement extendedTableSchemaFieldPropertyEl = doc->createElement(QLatin1String("property"));
2651 extendedTableSchemaFieldPropertyEl.setAttribute(QLatin1String("custom"), QLatin1String("true"));
2652 extendedTableSchemaFieldPropertyEl.setAttribute(QLatin1String("name"), QLatin1String(propertyName));
2690 const KDbField::Type type = f->type(); // cache: evaluating type of expressions can be expensive
2691 if (f->visibleDecimalPlaces() >= 0/*nondefault*/ && KDb::supportsVisibleDecimalPlacesProperty(type)) {
2890 defaultVariant = KDb::stringToVariant(defaultVariant.toString(), KDbField::variantType(f_type), &ok);
2946bool KDbConnection::storeDataBlock(int objectID, const QString &dataString, const QString& dataID)
2968 + KDbEscapedString::number(objectID) + ',' + d->driver->valueToSql(KDbField::LongText, dataString)
3055 || tableName == QLatin1String("kexi__final") || tableName == QLatin1String("kexi__useractions");
3098bool KDbConnection::updateRecord(KDbQuerySchema* query, KDbRecordData* data, KDbRecordEditBuffer* buf, bool useRecordId)
3116 KDbIndexSchema *pkey = (mt->primaryKey() && !mt->primaryKey()->fields()->isEmpty()) ? mt->primaryKey() : nullptr;
3137 continue; // skip values for fields outside of the master table (e.g. a "visible value" of the lookup field)
3200bool KDbConnection::insertRecord(KDbQuerySchema* query, KDbRecordData* data, KDbRecordEditBuffer* buf, bool getRecordId)
3242 //kdbDebug() << "adding default value" << ci->field->defaultValue().toString() << "for column" << ci->field->name();
3374 KDbIndexSchema *pkey = (mt->primaryKey() && !mt->primaryKey()->fields()->isEmpty()) ? mt->primaryKey() : nullptr;
3493int KDbConnection::recordCount(KDbTableOrQuerySchema* tableOrQuery, const QList<QVariant>& params)
Database specific connection data, e.g. host, port.
Definition KDbConnectionData.shared.h:36
Generic options for a single connection. The options are accessible using key/value pairs....
Definition KDbConnectionOptions.h:36
void setCaption(const QByteArray &name, const QString &caption)
Sets caption for option name to caption.
Definition KDbConnection.cpp:135
void insert(const QByteArray &name, const QVariant &value, const QString &caption=QString())
Inserts option with a given name, value and caption.
Definition KDbConnection.cpp:121
void setValue(const QByteArray &name, const QVariant &value)
Sets value for option name to value.
Definition KDbConnection.cpp:143
bool operator==(const KDbConnectionOptions &other) const
Definition KDbConnection.cpp:111
void remove(const QByteArray &name)
Removes option with a given name if exists.
Definition KDbConnection.cpp:152
Provides database connection, allowing queries and data modification.
Definition KDbConnection.h:52
bool updateRecord(KDbQuerySchema *query, KDbRecordData *data, KDbRecordEditBuffer *buf, bool useRecordId=false)
Definition KDbConnection.cpp:3098
virtual KDbEscapedString escapeString(const QString &str) const
Definition KDbConnection.cpp:3535
static QStringList kdbSystemTableNames()
Definition KDbConnection.cpp:1044
tristate loadObjectData(int type, int id, KDbObject *object)
Definition KDbConnection.cpp:2224
tristate loadDataBlock(int objectID, QString *dataString, const QString &dataID=QString())
Definition KDbConnection.cpp:2933
KDbField * setupField(const KDbRecordData &data)
Definition KDbConnection.cpp:2855
virtual bool drv_setAutoCommit(bool on)
Definition KDbConnection.cpp:2127
KDbTableSchema * copyTable(const KDbTableSchema &tableSchema, const KDbObject &newData)
Definition KDbConnection.cpp:1519
bool databaseExists(const QString &dbName, bool ignoreErrors=true)
Definition KDbConnection.cpp:630
bool queryStringList(const KDbEscapedString &sql, QStringList *list, int column=0)
Definition KDbConnection.cpp:2539
bool removeDataBlock(int objectID, const QString &dataID=QString())
Definition KDbConnection.cpp:2992
virtual bool drv_closeDatabase()=0
virtual KDbPreparedStatementInterface * prepareStatementInternal()=0
bool storeMainFieldSchema(KDbField *field)
Definition KDbConnection.cpp:1363
void setAvailableDatabaseName(const QString &dbName)
Definition KDbConnection.cpp:3073
bool setQuerySchemaObsolete(const QString &queryName)
Definition KDbConnection.cpp:3035
KDbProperties databaseProperties() const
Definition KDbConnection.cpp:1059
KDbPreparedStatement prepareStatement(KDbPreparedStatement::Type type, KDbFieldList *fields, const QStringList &whereFieldNames=QStringList())
Definition KDbConnection.cpp:3521
bool commitAutoCommitTransaction(const KDbTransaction &trans)
Definition KDbConnection.cpp:1924
tristate querySingleString(const KDbEscapedString &sql, QString *value, int column=0, QueryRecordOptions options=QueryRecordOption::Default)
Definition KDbConnection.cpp:2439
virtual bool drv_getServerVersion(KDbServerVersionInfo *version)=0
KDbCursor * executeQuery(const KDbEscapedString &sql, KDbCursor::Options options=KDbCursor::Option::None)
Definition KDbConnection.cpp:2132
virtual bool drv_alterTableName(KDbTableSchema *tableSchema, const QString &newName)
Definition KDbConnection.cpp:1798
bool closeDatabase()
Closes currently used database for this connection.
Definition KDbConnection.cpp:852
virtual bool drv_isDatabaseUsed() const
Definition KDbConnection.h:1159
virtual bool drv_executeSql(const KDbEscapedString &sql)=0
Executes query for a raw SQL statement sql without returning resulting records.
virtual bool drv_useDatabase(const QString &dbName=QString(), bool *cancelled=nullptr, KDbMessageHandler *msgHandler=nullptr)=0
void setDefaultTransaction(const KDbTransaction &trans)
Sets default transaction.
Definition KDbConnection.cpp:2079
QStringList tableNames(bool alsoSystemTables=false, bool *ok=nullptr)
Definition KDbConnection.cpp:1007
bool executeSql(const KDbEscapedString &sql)
Executes a new native (raw, backend-specific) SQL query.
Definition KDbConnection.cpp:1286
virtual KDbSqlResult * drv_prepareSql(const KDbEscapedString &sql)=0
Prepares query for a raw SQL statement sql with possibility of returning records.
tristate querySingleStringInternal(const KDbEscapedString *sql, QString *value, KDbQuerySchema *query, const QList< QVariant > *params, int column, QueryRecordOptions options)
Definition KDbConnection.cpp:2408
virtual bool drv_disconnect()=0
virtual QString escapeIdentifier(const QString &id) const
Identifier escaping function in the associated KDbDriver.
Definition KDbConnection.cpp:3044
virtual bool drv_createDatabase(const QString &dbName=QString())=0
bool storeDataBlock(int objectID, const QString &dataString, const QString &dataID=QString())
Definition KDbConnection.cpp:2946
tristate dropTable(KDbTableSchema *tableSchema)
Definition KDbConnection.cpp:1590
virtual QString anyAvailableDatabaseName()
Definition KDbConnection.cpp:3065
virtual KDbTransactionData * drv_beginTransaction()
Definition KDbConnection.cpp:2110
KDbServerVersionInfo serverVersion() const
Definition KDbConnection.cpp:1049
virtual bool drv_createTable(const KDbTableSchema &tableSchema)
Creates table using tableSchema information.
Definition KDbConnection.cpp:1874
tristate alterTable(KDbTableSchema *tableSchema, KDbTableSchema *newTableSchema)
Definition KDbConnection.cpp:1671
virtual bool drv_databaseExists(const QString &dbName, bool ignoreErrors=true)
Definition KDbConnection.cpp:613
virtual bool drv_copyTableData(const KDbTableSchema &tableSchema, const KDbTableSchema &destinationTableSchema)
Definition KDbConnection.cpp:1559
KDbField * findSystemFieldName(const KDbFieldList &fieldlist)
Definition KDbConnection.cpp:1303
bool dropDatabase(const QString &dbName=QString())
Drops database with name dbName.
Definition KDbConnection.cpp:920
QStringList databaseNames(bool also_system_db=false)
Definition KDbConnection.cpp:573
virtual KDbCursor * prepareQuery(const KDbEscapedString &sql, KDbCursor::Options options=KDbCursor::Option::None)=0
bool checkIfColumnExists(KDbCursor *cursor, int column)
Definition KDbConnection.cpp:2398
bool rollbackTransaction(KDbTransaction trans=KDbTransaction(), KDbTransaction::CommitOptions options=KDbTransaction::CommitOptions())
Rolls back specified transaction for this connection.
Definition KDbConnection.cpp:2029
virtual bool drv_dropDatabase(const QString &dbName=QString())=0
bool createTable(KDbTableSchema *tableSchema, CreateTableOptions options=CreateTableOption::Default)
Creates a new table.
Definition KDbConnection.cpp:1397
virtual bool drv_rollbackTransaction(KDbTransactionData *trans)
Definition KDbConnection.cpp:2122
KDbTransaction beginTransaction()
Starts a new database transaction.
Definition KDbConnection.cpp:1953
bool loadExtendedTableSchemaData(KDbTableSchema *tableSchema)
Definition KDbConnection.cpp:2751
bool deleteAllRecords(KDbQuerySchema *query)
Definition KDbConnection.cpp:3430
QStringList objectNames(int objectType=KDb::AnyObjectType, bool *ok=nullptr)
Definition KDbConnection.cpp:981
QSharedPointer< KDbSqlResult > prepareSql(const KDbEscapedString &sql)
Prepares execution of a new native (raw, backend-specific) SQL query.
Definition KDbConnection.cpp:1280
virtual bool drv_dropTable(const QString &tableName)
Definition KDbConnection.cpp:1585
QList< int > objectIds(int objectType, bool *ok=nullptr)
Definition KDbConnection.cpp:1074
tristate querySingleRecordInternal(KDbRecordData *data, const KDbEscapedString *sql, KDbQuerySchema *query, const QList< QVariant > *params, QueryRecordOptions options)
Definition KDbConnection.cpp:2353
bool storeObjectData(KDbObject *object)
Definition KDbConnection.cpp:2319
tristate querySingleRecord(const KDbEscapedString &sql, KDbRecordData *data, QueryRecordOptions options=QueryRecordOption::Default)
Definition KDbConnection.cpp:2380
KDbTableSchema * tableSchema(int tableId)
Definition KDbConnection.cpp:2919
bool storeExtendedTableSchemaData(KDbTableSchema *tableSchema)
Definition KDbConnection.cpp:2680
KDbCursor * executeQueryInternal(const KDbEscapedString &sql, KDbQuerySchema *query, const QList< QVariant > *params)
Definition KDbConnection.cpp:2335
bool dropQuery(KDbQuerySchema *querySchema)
Definition KDbConnection.cpp:1813
virtual bool drv_connect()=0
bool copyDataBlock(int sourceObjectID, int destObjectID, const QString &dataID=QString())
Definition KDbConnection.cpp:2972
tristate querySingleNumber(const KDbEscapedString &sql, int *number, int column=0, QueryRecordOptions options=QueryRecordOption::Default)
Definition KDbConnection.cpp:2477
bool createDatabase(const QString &dbName)
Creates new database with name dbName, using this connection.
Definition KDbConnection.cpp:695
QString currentDatabase() const
Get the name of the current database.
Definition KDbConnection.cpp:892
@ DropDestination
Drop destination table if exists.
bool useDatabase(const QString &dbName=QString(), bool kexiCompatible=true, bool *cancelled=nullptr, KDbMessageHandler *msgHandler=nullptr)
Opens an existing database specified by dbName.
Definition KDbConnection.cpp:787
virtual bool drv_beforeInsert(const QString &tableName, KDbFieldList *fields)
Definition KDbConnection.h:1219
virtual bool drv_afterInsert(const QString &tableName, KDbFieldList *fields)
Definition KDbConnection.h:1231
int recordCount(const KDbEscapedString &sql)
Returns number of records returned by given SQL statement.
Definition KDbConnection.cpp:3453
bool setupObjectData(const KDbRecordData &data, KDbObject *object)
Definition KDbConnection.cpp:2199
virtual KDbEscapedString recentSqlString() const
Return recently used SQL string.
Definition KDbConnection.cpp:3531
bool beginAutoCommitTransaction(KDbTransactionGuard *tg)
Definition KDbConnection.cpp:1893
KDbVersionInfo databaseVersion() const
Definition KDbConnection.cpp:1054
bool alterTableName(KDbTableSchema *tableSchema, const QString &newName, AlterTableNameOptions options=AlterTableNameOption::Default)
Alters name of table.
Definition KDbConnection.cpp:1700
bool rollbackAutoCommitTransaction(const KDbTransaction &trans)
Definition KDbConnection.cpp:1937
tristate resultExists(const KDbEscapedString &sql, QueryRecordOptions options=QueryRecordOption::Default)
Definition KDbConnection.cpp:2556
@ AddLimitTo1
Adds a "LIMIT 1" clause to the query for optimization purposes (it should not include one already)
virtual bool drv_afterUpdate(const QString &tableName, KDbFieldList *fields)
Definition KDbConnection.h:1255
bool deleteRecord(KDbQuerySchema *query, KDbRecordData *data, bool useRecordId=false)
Definition KDbConnection.cpp:3363
QList< KDbTransaction > transactions()
Returns set of handles of currently active transactions.
Definition KDbConnection.cpp:2090
tristate dropTableInternal(KDbTableSchema *tableSchema, bool alsoRemoveSchema)
Definition KDbConnection.cpp:1595
bool useTemporaryDatabaseIfNeeded(QString *name)
Definition KDbConnection.cpp:897
virtual bool drv_beforeUpdate(const QString &tableName, KDbFieldList *fields)
Definition KDbConnection.h:1243
QSharedPointer< KDbSqlResult > insertRecordInternal(const QString &tableSchemaName, KDbFieldList *fields, const KDbEscapedString &sql)
Definition KDbConnection.cpp:1119
KDbQuerySchema * querySchema(int queryId)
Definition KDbConnection.cpp:3021
bool storeNewObjectData(KDbObject *object)
Definition KDbConnection.cpp:2324
bool commitTransaction(KDbTransaction transaction=KDbTransaction(), KDbTransaction::CommitOptions options=KDbTransaction::CommitOptions())
Commits specified transaction for this connection.
Definition KDbConnection.cpp:1992
virtual bool drv_commitTransaction(KDbTransactionData *trans)
Definition KDbConnection.cpp:2117
KDbTransaction defaultTransaction() const
Returns handle of default transaction for this connection.
Definition KDbConnection.cpp:2074
virtual tristate drv_containsTable(const QString &tableName)=0
virtual bool drv_getDatabasesList(QStringList *list)
Definition KDbConnection.cpp:607
tristate querySingleNumberInternal(const KDbEscapedString *sql, int *number, KDbQuerySchema *query, const QList< QVariant > *params, int column, QueryRecordOptions options)
Definition KDbConnection.cpp:2458
tristate containsTable(const QString &tableName)
Definition KDbConnection.cpp:1039
bool queryStringListInternal(const KDbEscapedString *sql, QStringList *list, KDbQuerySchema *query, const QList< QVariant > *params, int column, bool(*filterFunction)(const QString &))
Definition KDbConnection.cpp:2496
virtual QVariant value(int i)=0
void setQueryParameters(const QList< QVariant > ¶ms)
Sets query parameters params for this cursor.
Definition KDbCursor.cpp:612
@ MultipleTransactions
multiple concurrent trasactions are supported (this implies !SingleTransactions)
Definition KDbDriver.h:61
Definition KDbFieldList.h:34
KDbFieldList * subList(const QString &n1, const QString &n2=QString(), const QString &n3=QString(), const QString &n4=QString(), const QString &n5=QString(), const QString &n6=QString(), const QString &n7=QString(), const QString &n8=QString(), const QString &n9=QString(), const QString &n10=QString(), const QString &n11=QString(), const QString &n12=QString(), const QString &n13=QString(), const QString &n14=QString(), const QString &n15=QString(), const QString &n16=QString(), const QString &n17=QString(), const QString &n18=QString())
Definition KDbFieldList.cpp:251
KDbField::ListIterator fieldsIterator() const
Definition KDbFieldList.cpp:340
KDbField::ListIterator fieldsIteratorConstEnd() const
Definition KDbFieldList.cpp:345
KDbEscapedString sqlFieldsList(KDbConnection *conn, const QString &separator=QLatin1String(","), const QString &tableOrAlias=QString(), KDb::IdentifierEscapingType escapingType=KDb::DriverEscaping) const
Definition KDbFieldList.cpp:385
QVariant::Type variantType() const
Converts field's type to QVariant equivalent as accurate as possible.
Definition KDbField.h:368
static QVariant::Type variantType(Type type)
Converts type type to QVariant equivalent as accurate as possible.
Definition KDbField.cpp:387
@ DefaultMaxLength
Default maximum text length defined globally by the application.
Definition KDbField.h:430
@ DefinedMaxLength
Used if setMaxLength() was called to set specific maximum value or to unlimited (0).
Definition KDbField.h:432
void setMaxLengthStrategy(MaxLengthStrategy strategy)
Definition KDbField.cpp:660
void setCustomProperty(const QByteArray &propertyName, const QVariant &value)
Sets value value for custom property propertyName.
Definition KDbField.cpp:1042
Provides information about database index that can be created for a database table.
Definition KDbIndexSchema.h:40
Definition KDbTableSchema.h:210
Provides information about lookup field's setup.
Definition KDbLookupFieldSchema.h:124
void saveToDom(QDomDocument *doc, QDomElement *parentEl)
Definition KDbLookupFieldSchema.cpp:479
static KDbLookupFieldSchema * loadFromDom(const QDomElement &lookupEl)
Definition KDbLookupFieldSchema.cpp:346
Definition KDbMessageHandler.h:135
A builder for generating various types of native SQL statements.
Definition KDbNativeStatementBuilder.h:30
bool generateCreateTableStatement(KDbEscapedString *target, const KDbTableSchema &tableSchema) const
Definition KDbNativeStatementBuilder.cpp:446
bool generateSelectStatement(KDbEscapedString *target, KDbQuerySchema *querySchema, const KDbSelectStatementOptions &options, const QList< QVariant > ¶meters=QList< QVariant >()) const
Definition KDbNativeStatementBuilder.cpp:423
Definition KDbObject.shared.h:32
Prepared statement interface for backend-dependent implementations.
Definition KDbPreparedStatementInterface.h:32
Prepared database command for optimizing sequences of multiple database actions.
Definition KDbPreparedStatement.h:76
Helper class that assigns additional information for the column in a query.
Definition KDbQueryColumnInfo.h:41
KDbQuerySchema provides information about database query.
Definition KDbQuerySchema.h:46
Structure for storing single record with type information.
Definition KDbRecordData.h:37
provides data for single edited database record
Definition KDbRecordEditBuffer.h:77
Definition KDbResult.shared.h:35
void prependMessage(int code, const QString &message)
Sets result code and prepends message to an existing message.
Definition KDbResult.cpp:80
static tristate closeListeners(KDbConnection *conn, const KDbTableSchema *table, const QList< KDbTableSchemaChangeListener * > &except=QList< KDbTableSchemaChangeListener * >())
Closes all table schema listeners for table schema table except for the ones from the except list.
Definition KDbTableSchemaChangeListener.cpp:530
static void unregisterForChanges(KDbConnection *conn, KDbTableSchemaChangeListener *listener, const KDbTableSchema *table)
Unregisters listener for receiving (listening) information about changes in table schema table.
Definition KDbTableSchemaChangeListener.cpp:412
Definition KDbTableSchema.h:38
void setConnection(KDbConnection *conn)
Definition KDbTableSchema.cpp:346
KDbLookupFieldSchema * lookupFieldSchema(const KDbField &field)
Definition KDbTableSchema.cpp:388
bool setLookupFieldSchema(const QString &fieldName, KDbLookupFieldSchema *lookupFieldSchema)
Definition KDbTableSchema.cpp:373
Internal prototype for storing transaction handle for KDbTransaction object.
Definition KDbTransactionData.h:36
KDbTransactionGuard class is a convenience class that simplifies handling transactions.
Definition KDbTransactionGuard.h:52
const KDbTransaction transaction() const
Returns transaction that is controlled by this guard.
Definition KDbTransaction.cpp:261
void setTransaction(const KDbTransaction &transaction)
Assigns transaction to this guard.
Definition KDbTransaction.cpp:235
@ IgnoreInactive
Do not return error for inactive or null transactions when requesting commit or rollback.
void setValue(const QByteArray &name, const QVariant &value)
Sets value for property name to value.
Definition KDbUtils.cpp:686
Property property(const QByteArray &name) const
Definition KDbUtils.cpp:699
PropertySet & operator=(const PropertySet &other)
Assigns other to this property set and returns a reference to this property set.
Definition KDbUtils.cpp:646
void setCaption(const QByteArray &name, const QString &caption)
Sets caption for property name to caption.
Definition KDbUtils.cpp:678
void insert(const QByteArray &name, const QVariant &value, const QString &caption=QString())
Inserts property with a given name, value and caption.
Definition KDbUtils.cpp:660
bool operator==(const PropertySet &other) const
Definition KDbUtils.cpp:655
Definition KDbVersionInfo.shared.h:44
3-state logical type with three values: true, false and cancelled and convenient operators.
Definition KDbTristate.h:101
Type type(const QSqlDatabase &db)
std::optional< QSqlQuery > query(const QString &queryStatement)
KDB_EXPORT bool isIdentifier(const QString &s)
KDB_EXPORT QString escapeIdentifier(const QString &string)
Definition KDb.cpp:1334
KDB_EXPORT quint64 lastInsertedAutoIncValue(QSharedPointer< KDbSqlResult > result, const QString &autoIncrementFieldName, const QString &tableName, quint64 *recordId=nullptr)
Returns value of last inserted record for an autoincrement field.
Definition KDb.cpp:392
KDB_EXPORT bool deleteRecords(KDbConnection *conn, const QString &tableName, const QString &keyname, KDbField::Type keytype, const QVariant &keyval)
Deletes records using one generic criteria.
Definition KDb.cpp:342
KDB_EXPORT KDbEscapedString sqlWhere(KDbDriver *drv, KDbField::Type t, const QString &fieldName, const QVariant &value)
Definition KDb.cpp:440
KDB_EXPORT QString variantToString(const QVariant &v)
KDB_EXPORT bool supportsVisibleDecimalPlacesProperty(KDbField::Type type)
Definition KDb.cpp:623
KDB_EXPORT QString stringToIdentifier(const QString &s)
KDB_EXPORT int loadIntPropertyValueFromDom(const QDomNode &node, bool *ok)
Definition KDb.cpp:1097
KDB_EXPORT QVariant loadPropertyValueFromDom(const QDomNode &node, bool *ok)
Definition KDb.cpp:1123
KDB_EXPORT QVariant stringToVariant(const QString &s, QVariant::Type type, bool *ok)
KDB_EXPORT bool isDefaultValueAllowed(const KDbField &field)
KGuiItem ok()
const QList< QKeySequence > & copy()
bool operator==(const StyleDelim &l, const StyleDelim &r)
FeedPtr parse(const DocumentSource &src, const QString &formatHint=QString())
QByteArray number(double n, char format, int precision)
QString fromNativeSeparators(const QString &pathName)
QChar separator()
QDomElement createElement(const QString &tagName)
QDomText createTextNode(const QString &value)
QDomDocumentType doctype() const const
QDomElement documentElement() const const
ParseResult setContent(QAnyStringView text, ParseOptions options)
QString toString(int indent) const const
QString name() const const
QString attribute(const QString &name, const QString &defValue) const const
void setAttribute(const QString &name, const QString &value)
QString tagName() const const
QDomNode appendChild(const QDomNode &newChild)
QDomNode firstChild() const const
bool hasChildNodes() const const
bool isNull() const const
QDomElement toElement() const const
QString absoluteFilePath() const const
QString absolutePath() const const
bool exists(const QString &path)
QString fileName() const const
bool isFile() const const
bool isReadable() const const
bool isSymLink() const const
bool isWritable() const const
ConstIterator
const_iterator constBegin() const const
const_iterator constEnd() const const
const_iterator constFind(const Key &key) const const
bool contains(const Key &key) const const
iterator insert(const Key &key, const T &value)
bool isEmpty() const const
T value(const Key &key) const const
ConstIterator
void append(QList< T > &&value)
const_reference at(qsizetype i) const const
void clear()
const_iterator constBegin() const const
const_iterator constEnd() const const
qsizetype count() const const
iterator end()
T & first()
bool isEmpty() const const
qsizetype size() const const
T value(qsizetype i) const const
bool hasNext() const const
T * take()
T * data() const const
bool contains(const QSet< T > &other) const const
iterator insert(const T &value)
int compare(QLatin1StringView s1, const QString &s2, Qt::CaseSensitivity cs)
bool isEmpty() const const
QString left(qsizetype n) const const
QString number(double n, char format, int precision)
int toInt(bool *ok, int base) const const
QByteArray toLatin1() const const
QString toLower() const const
QString trimmed() const const
qsizetype indexOf(const QRegularExpression &re, qsizetype from) const const
CaseInsensitive
String
Type type() const const
bool isNull() const const
bool isValid() const const
bool toBool() const const
int toInt(bool *ok) const const
QString toString() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.