KDb
KDbNativeStatementBuilder.cpp
183 // Now we also need to fetch "visible" value from the lookup table, not only the value of binding.
184 // -> build LEFT OUTER JOIN clause for this purpose (LEFT, not INNER because the binding can be broken)
212//! @todo Add lookup schema option for separator other than ' ' or even option for placeholders like "Name ? ?"
268//! @todo Add lookup schema option for separator other than ' ' or even option for placeholders like "Name ? ?"
303 s += KDb::escapeIdentifier(driver, querySchema->tableAliasOrName(querySchema->masterTable()->name()));
435 return selectStatementInternal(target, d->connection, d->dialect, querySchema, KDbSelectStatementOptions(),
453 const KDbDriver *driver = d->dialect == KDb::DriverEscaping ? d->connection->driver() : nullptr;
466 const bool pk = field->isPrimaryKey() || (autoinc && driver && driver->behavior()->AUTO_INCREMENT_REQUIRES_PK);
467//! @todo warning: ^^^^^ this allows only one autonumber per table when AUTO_INCREMENT_REQUIRES_PK==true!
468 const KDbField::Type type = field->type(); // cache: evaluating type of expressions can be expensive
502 realMaxLen = qMin(d->connection->driver()->behavior()->TEXT_TYPE_MAX_LENGTH, field->maxLength());
Provides database connection, allowing queries and data modification.
Definition KDbConnection.h:52
KDbTableSchema * tableSchema(int tableId)
Definition KDbConnection.cpp:2919
KDbQuerySchema * querySchema(int queryId)
Definition KDbConnection.cpp:3021
QString AUTO_INCREMENT_FIELD_OPTION
"AUTO_INCREMENT" by default, used as add-in word to field definition May be also used as full definit...
Definition KDbDriverBehavior.h:63
QString AUTO_INCREMENT_PK_FIELD_OPTION
"AUTO_INCREMENT PRIMARY KEY" by default, used as add-in word to field definition May be also used as ...
Definition KDbDriverBehavior.h:67
bool SPECIAL_AUTO_INCREMENT_DEF
Definition KDbDriverBehavior.h:77
QString AUTO_INCREMENT_TYPE
"" by default, used as type string for autoinc.
Definition KDbDriverBehavior.h:71
virtual QString sqlTypeName(KDbField::Type type, const KDbField &field) const
Definition KDbDriver.cpp:130
virtual bool supportsDefaultValue(const KDbField &field) const
Definition KDbDriver.h:407
KDbDriverBehavior * behavior()
Returns structure that provides detailed information about driver's default behavior.
Definition KDbDriver.cpp:74
virtual KDbEscapedString valueToSql(KDbField::Type ftype, const QVariant &v) const
Definition KDbDriver.cpp:246
KDbEscapedString toString(const KDbDriver *driver, KDbQuerySchemaParameterValueListIterator *params=nullptr, KDb::ExpressionCallStack *callStack=nullptr) const
Definition KDbExpression.cpp:469
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
KDbEscapedString sqlFieldsList(KDbConnection *conn, const QString &separator=QLatin1String(","), const QString &tableOrAlias=QString(), KDb::IdentifierEscapingType escapingType=KDb::DriverEscaping) const
Definition KDbFieldList.cpp:385
Record source information that can be specified for the lookup field schema.
Definition KDbLookupFieldSchema.h:50
QString typeName() const
Definition KDbLookupFieldSchema.cpp:155
Provides information about lookup field's setup.
Definition KDbLookupFieldSchema.h:124
QList< int > visibleColumns() const
Definition KDbLookupFieldSchema.cpp:685
KDbLookupFieldSchemaRecordSource recordSource() const
Definition KDbLookupFieldSchema.cpp:282
A builder for generating various types of native SQL statements.
Definition KDbNativeStatementBuilder.h:30
KDbNativeStatementBuilder(KDbConnection *connection, KDb::IdentifierEscapingType dialect)
Creates a new native builder object.
Definition KDbNativeStatementBuilder.cpp:53
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
KDbOrderByColumnList provides list of sorted columns for a query schema.
Definition KDbOrderByColumn.h:128
KDbEscapedString toSqlString(bool includeTableNames, KDbConnection *conn, KDbQuerySchema *query, KDb::IdentifierEscapingType escapingType=KDb::DriverEscaping) const
Return an SQL string like "name ASC, 2 DESC" usable for building an SQL statement.
Definition KDbOrderByColumn.cpp:449
void appendColumn(KDbQueryColumnInfo *columnInfo, KDbOrderByColumn::SortOrder order=KDbOrderByColumn::SortOrder::Ascending)
Definition KDbOrderByColumn.cpp:352
KDbQueryAsterisk class encapsulates information about single asterisk in query definition.
Definition KDbQueryAsterisk.h:51
bool isSingleTableAsterisk() const
Definition KDbQueryAsterisk.cpp:93
Helper class that assigns additional information for the column in a query.
Definition KDbQueryColumnInfo.h:41
An iterator for a list of values of query schema parameters Allows to iterate over parameters and ret...
Definition KDbQuerySchemaParameter.shared.h:50
KDbQuerySchema provides information about database query.
Definition KDbQuerySchema.h:46
KDbQueryColumnInfo::Vector fieldsExpanded(KDbConnection *conn, FieldsExpandedMode mode=FieldsExpandedMode::Default) const
Definition KDbQuerySchema.h:501
KDbExpression whereExpression() const
Definition KDbQuerySchema.cpp:1354
int tableBoundToColumn(int columnPosition) const
Definition KDbQuerySchema.cpp:206
bool isColumnVisible(int position) const
Definition KDbQuerySchema.cpp:281
KDbOrderByColumnList * orderByColumnList()
Definition KDbQuerySchema.cpp:1366
QString tableAliasOrName(const QString &tableName) const
Definition KDbQuerySchema.cpp:588
QVector< int > pkeyFieldsOrder(KDbConnection *conn) const
Definition KDbQuerySchema.cpp:1158
QList< KDbRelationship * > * relationships() const
Definition KDbQuerySchema.cpp:664
Options used in KDbNativeStatementBuilder::generateSelectStatement()
Definition KDbSelectStatementOptions.shared.h:32
bool alsoRetrieveRecordId
Definition KDbSelectStatementOptions.shared.h:40
bool addVisibleLookupColumns
Definition KDbSelectStatementOptions.shared.h:50
Definition KDbTableSchema.h:38
KDbLookupFieldSchema * lookupFieldSchema(const KDbField &field)
Definition KDbTableSchema.cpp:388
KDB_EXPORT QString escapeIdentifier(const QString &string)
Definition KDb.cpp:1334
KIOCORE_EXPORT QString number(KIO::filesize_t size)
qsizetype count() const const
bool isEmpty() const const
QString arg(Args &&... args) const const
QString fromLatin1(QByteArrayView str)
bool isEmpty() const const
QString number(double n, char format, int precision)
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.