KDb
KDb.h
48//! @see KDbConnection::databaseVersion() KDbConnection::serverVersion() KDbDriverMetaData::version()
119 * The field must be of integer type, there must be a record inserted using query for which the @a
167 For KDbField::BLOB type it returns a translated "Image" string or other, depending on the mime type.
178 - Case 3: If field type @a type is of any other type then the function returns true if value.isNull().
193KDB_EXPORT void getHTMLErrorMesage(const KDbResultable& resultable, QString *msg, QString *details);
198 * This methods works similarly but appends both a message and a description to string pointed by
236 * On successful connecting, a successfull message of type KDbMessageHandler::Information is passed
239 * @return @c true for successfull connecting, @c for failed connecting and @c cancelled if the test
249};
295 * This method is similar to KDb::numberToString() but the string is formatted using QLocale::toString().
335KDB_EXPORT void getProperties(const KDbLookupFieldSchema *lookup, QMap<QByteArray, QVariant> *values);
348 This function is used e.g. by KDbAlterTableHandler when property information comes in form of text.
353/*! Sets value of a single property for @a field. @return true if the property has been found and
358 This function is used e.g. by KDbAlterTableHandler when property information comes in form of text.
365 notation: <number>int</number> or <bool>bool</bool>, etc. Supported types are
367 Validity of the returned value can be checked using the @a ok parameter and QVariant::type(). */
376/*! Creates a new DOM element named @a elementName with numeric value @a value in @a doc document
389/*! Creates a new DOM element named @a elementName with boolean value @a value in @a doc document
403//! @return equivalent of empty (default) value that can be set for a database field of type @a type
414//! @return a value that can be set for a database field of type @a type having "notEmpty" property set.
466 * If @a conn is present, its driver is used to perform escaping, otherwise escapeString() is used
477 * @return unescaped string and sets value pointed by @a errorPosition (if any) to -1 on success;
479 * The function fails when unsupported @a quote character is passed or for unsupported sequences.
496 * Following sequences are always unescaped (selection based on a mix of MySQL and C/JavaScript):
529 * - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#Using_special_characters_in_strings
530 * - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#String_literals
532KDB_EXPORT QString unescapeString(const QString& string, char quote, int *errorPosition = nullptr);
578KDB_EXPORT QByteArray zeroXHexToByteArray(const char* data, int length = -1, bool *ok = nullptr);
611 @a ok is set to the result of the operation. With exception for types mentioned in documentation
626KDB_EXPORT void getLimitsForFieldType(KDbField::Type type, qlonglong *minValue, qlonglong *maxValue,
629/*! @return type that's maximum of two integer types @a t1 and @a t2, e.g. Integer for (Byte, Integer).
632 For example, 100 is within Byte type, maximumForIntegerFieldTypes(Byte, Byte) is Byte but result
649KDB_EXPORT QVariant cstringToVariant(const char* data, KDbField::Type type, bool *ok, int length = -1,
666 * Converts date/time value to its string representation in ISO 8601 DateTime format - with "T" delimiter
668 * @note This method is deprecated since 3.1.1, use KDb::dateTimeToIsoString() which has identical
676 * Date/Time types. By implementing wish https://bugs.kde.org/393094 format of date/time constants
708 * If the @a v value is convertible to KDbTime then KDbTime::toString() is used to obtain the result.
723 * Converts date/time value to its string representation in ISO 8601 DateTime format - with "T" delimiter
726 * date/time type. It is used as default implementation for drivers in KDbDriver::dateTimeToSql().
728 * If the @a v value is convertible to KDbDateTime then KDbDateTime::toString() is used to obtain
746 * The value can be of type QDate or KDbDate. If the value is not one of these types or is invalid
748 * that is not null then even if some components of the date are invalid, properly formatted string
762 * The value can be of type QTime or KDbTime. If the value is not one of these types or is invalid
764 * that is not null then even if some components of the time are invalid, properly formatted string
850 This is basicaly list of directories returned QCoreApplication::libraryPaths() that have readable
Database specific connection data, e.g. host, port.
Definition KDbConnectionData.shared.h:36
Provides database connection, allowing queries and data modification.
Definition KDbConnection.h:52
Provides information about lookup field's setup.
Definition KDbLookupFieldSchema.h:124
Definition KDbMessageHandler.h:135
Definition KDbError.h:115
Definition KDbTableSchema.h:38
Definition KDbVersionInfo.shared.h:44
3-state logical type with three values: true, false and cancelled and convenient operators.
Definition KDbTristate.h:101
KDB_EXPORT KDbEscapedString timeToSql(const QVariant &v)
Converts time value to its string representation required by KDBSQL commands.
KDB_EXPORT KDbEscapedString dateToSql(const QVariant &v)
Converts date value to its string representation required by KDBSQL commands.
KDB_EXPORT QString sqlite3ProgramPath()
KDB_EXPORT QString escapeIdentifierAndAddQuotes(const QString &string)
Definition KDb.cpp:1346
KDB_EXPORT QDomElement saveNumberElementToDom(QDomDocument *doc, QDomElement *parentEl, const QString &elementName, int value)
Definition KDb.cpp:1169
KDB_EXPORT bool isExtendedTableFieldProperty(const QByteArray &propertyName)
for isExtendedTableProperty()
Definition KDb.cpp:954
KDB_EXPORT QString numberToString(double value, int decimalPlaces)
Definition KDb.cpp:654
KDB_EXPORT void getProperties(const KDbLookupFieldSchema *lookup, QMap< QByteArray, QVariant > *values)
Definition KDb.cpp:758
KDB_EXPORT QString escapeBLOB(const QByteArray &array, BLOBEscapingType type)
KDB_EXPORT bool setFieldProperties(KDbField *field, const QMap< QByteArray, QVariant > &values)
Definition KDb.cpp:833
KDB_EXPORT const QList< KDbField::Type > fieldTypesForGroup(KDbField::TypeGroup typeGroup)
Definition KDb.cpp:485
KDB_EXPORT bool isIdentifier(const QString &s)
KDB_EXPORT QByteArray pgsqlByteaToByteArray(const char *data, int length=-1)
KDB_EXPORT QString escapeIdentifier(const QString &string)
Definition KDb.cpp:1334
KDB_EXPORT KDbEscapedString timeToIsoString(const QVariant &v)
Converts time value to its string representation in ISO 8601 Time format.
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 QString defaultFileBasedDriverMimeType()
KDB_EXPORT KDbEscapedString sqlWhere(KDbDriver *drv, KDbField::Type t, const QString &fieldName, const QVariant &value)
Definition KDb.cpp:440
KDB_EXPORT KDbField::Type maximumForIntegerFieldTypes(KDbField::Type t1, KDbField::Type t2)
KDB_EXPORT QStringList deserializeList(const QString &data)
KDB_EXPORT bool isEmptyValue(KDbField::Type type, const QVariant &value)
Definition KDb.cpp:429
KDB_EXPORT QStringList fieldTypeStringsForGroup(KDbField::TypeGroup typeGroup)
Definition KDb.cpp:495
KDB_EXPORT QString defaultFileBasedDriverId()
KDB_EXPORT bool isLookupFieldSchemaProperty(const QByteArray &propertyName)
for isLookupFieldSchemaProperty()
Definition KDb.cpp:976
KDB_EXPORT KDbEscapedString dateToIsoString(const QVariant &v)
Converts date value to its string representation in ISO 8601 DateTime format.
KDB_EXPORT void getFieldProperties(const KDbField &field, QMap< QByteArray, QVariant > *values)
Definition KDb.cpp:787
KDB_EXPORT bool importSqliteFile(const QString &inputFileName, const QString &outputFileName)
KDB_EXPORT QString variantToString(const QVariant &v)
KDB_EXPORT bool isKDbSqlKeyword(const QByteArray &word)
KDB_EXPORT KDbField::Type defaultFieldTypeForGroup(KDbField::TypeGroup typeGroup)
Definition KDb.cpp:500
KDB_EXPORT QList< int > stringListToIntList(const QStringList &list, bool *ok=nullptr)
KDB_EXPORT bool supportsVisibleDecimalPlacesProperty(KDbField::Type type)
Definition KDb.cpp:623
KDB_EXPORT bool isBuiltinTableFieldProperty(const QByteArray &propertyName)
for KDb::isBuiltinTableFieldProperty()
Definition KDb.cpp:734
KDB_EXPORT QStringList fieldTypeNamesForGroup(KDbField::TypeGroup typeGroup)
Definition KDb.cpp:490
KDB_EXPORT QString identifierExpectedMessage(const QString &valueName, const QVariant &v)
KDB_EXPORT KDbEscapedString dateTimeToIsoString(const QVariant &v)
Converts date/time value to its string representation in ISO 8601 DateTime format - with "T" delimite...
KDB_EXPORT QString stringToIdentifier(const QString &s)
KDB_EXPORT QString loadStringPropertyValueFromDom(const QDomNode &node, bool *ok)
Definition KDb.cpp:1110
KDB_EXPORT QVariant notEmptyValueForFieldType(KDbField::Type type)
Used in KDb::notEmptyValueForFieldType()
Definition KDb.cpp:1275
KDB_EXPORT QString simplifiedFieldTypeName(KDbField::Type type)
KDB_EXPORT KDbEscapedString valueToSql(KDbField::Type ftype, const QVariant &v)
KDB_EXPORT bool setFieldProperty(KDbField *field, const QByteArray &propertyName, const QVariant &value)
Definition KDb.cpp:981
KDB_EXPORT QDomElement saveBooleanElementToDom(QDomDocument *doc, QDomElement *parentEl, const QString &elementName, bool value)
Definition KDb.cpp:1183
KDB_EXPORT QVariant emptyValueForFieldType(KDbField::Type type)
Used in KDb::emptyValueForFieldType()
Definition KDb.cpp:1222
KDB_EXPORT int loadIntPropertyValueFromDom(const QDomNode &node, bool *ok)
Definition KDb.cpp:1097
KDB_EXPORT QString serializeList(const QStringList &list)
KDB_EXPORT tristate showConnectionTestDialog(QWidget *parent, const KDbConnectionData &data, KDbMessageHandler *msgHandler)
Shows connection test dialog.
Definition KDb.cpp:592
KDB_EXPORT bool deleteAllRecords(KDbConnection *conn, const QString &tableName)
Deletes all records from table tableName.
Definition KDb.cpp:384
KDB_EXPORT tristate idForObjectName(KDbConnection *conn, int *id, const QString &objName, int objType)
Finds an identifier for object objName of type objType.
Definition KDb.cpp:579
KDB_EXPORT void getLimitsForFieldType(KDbField::Type type, qlonglong *minValue, qlonglong *maxValue, KDb::Signedness signedness=KDb::Signed)
Provides limits for values of type type.
KDB_EXPORT QString unescapeString(const QString &string, char quote, int *errorPosition=nullptr)
Unescapes characters in string string for the KDBSQL dialect.
KDB_EXPORT QVariant cstringToVariant(const char *data, KDbField::Type type, bool *ok, int length=-1, KDb::Signedness signedness=KDb::Signed)
KDB_EXPORT QStringList libraryPaths()
KDB_EXPORT QString numberToLocaleString(double value, int decimalPlaces)
Returns number converted to string using default locale.
Definition KDb.cpp:659
KDB_EXPORT bool splitToTableAndFieldParts(const QString &string, QString *tableName, QString *fieldName, SplitToTableAndFieldPartsOptions option=FailIfNoTableOrFieldName)
Definition KDb.cpp:603
KDB_EXPORT KDbField::TypeGroup intToFieldTypeGroup(int typeGroup)
Definition KDb.cpp:678
KDB_EXPORT QByteArray xHexToByteArray(const char *data, int length=-1, bool *ok=nullptr)
KDB_EXPORT QVariant loadPropertyValueFromDom(const QDomNode &node, bool *ok)
Definition KDb.cpp:1123
KDB_EXPORT QByteArray zeroXHexToByteArray(const char *data, int length=-1, bool *ok=nullptr)
KDB_EXPORT void getHTMLErrorMesage(const KDbResultable &resultable, QString *msg, QString *details)
Sets HTML-formatted error message with extra details obtained from result object.
Definition KDb.cpp:505
KDB_EXPORT QVariant stringToVariant(const QString &s, QVariant::Type type, bool *ok)
KDB_EXPORT QString temporaryTableName(KDbConnection *conn, const QString &baseName)
KDB_EXPORT bool isDefaultValueAllowed(const KDbField &field)
KDB_DEPRECATED_EXPORT KDbEscapedString dateTimeToSql(const QDateTime &v)
Converts date/time value to its string representation in ISO 8601 DateTime format - with "T" delimite...
KDB_EXPORT QList< int > deserializeIntList(const QString &data, bool *ok)
Type
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:07 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:07 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.