KDbTableOrQuerySchema

Search for usage in LXR

KDbTableOrQuerySchema Class Reference

#include <KDbTableOrQuerySchema.h>

Public Types

enum class  ColumnsMode { NonUnique , Unique }
 
enum class  Type { Table , Query }
 

Public Member Functions

 KDbTableOrQuerySchema (KDbConnection *conn, const QByteArray &name)
 
 KDbTableOrQuerySchema (KDbConnection *conn, const QByteArray &name, Type type)
 
 KDbTableOrQuerySchema (KDbConnection *conn, int id)
 
 KDbTableOrQuerySchema (KDbFieldList *tableOrQuery)
 
 KDbTableOrQuerySchema (KDbQuerySchema *query)
 
 KDbTableOrQuerySchema (KDbTableSchema *table)
 
QString captionOrName () const
 
KDbQueryColumnInfocolumnInfo (KDbConnection *conn, const QString &name)
 
const KDbQueryColumnInfo::Vector columns (KDbConnection *conn, ColumnsMode mode=ColumnsMode::NonUnique)
 
KDbFieldfield (const QString &name)
 
int fieldCount (KDbConnection *conn) const
 
QByteArray name () const
 
KDbQuerySchemaquery () const
 
KDbTableSchematable () const
 

Detailed Description

Variant class providing a pointer to table or query.

Definition at line 33 of file KDbTableOrQuerySchema.h.

Member Enumeration Documentation

◆ ColumnsMode

Mode for columns().

Enumerator
NonUnique 

Non-unique columns are returned.

Unique 

Unique columns are returned.

Definition at line 99 of file KDbTableOrQuerySchema.h.

◆ Type

enum class KDbTableOrQuerySchema::Type
strong

Type of object: table or query.

Since
3.1

Definition at line 38 of file KDbTableOrQuerySchema.h.

Constructor & Destructor Documentation

◆ KDbTableOrQuerySchema() [1/6]

KDbTableOrQuerySchema::KDbTableOrQuerySchema ( KDbConnection * conn,
const QByteArray & name )

Creates a new KDbTableOrQuerySchema variant object, retrieving table or query schema using conn connection and name. If both table and query exists for name, table has priority over query. Check whether a query or table has been found by testing (query() || table()) expression.

Definition at line 43 of file KDbTableOrQuerySchema.cpp.

◆ KDbTableOrQuerySchema() [2/6]

KDbTableOrQuerySchema::KDbTableOrQuerySchema ( KDbConnection * conn,
const QByteArray & name,
Type type )

Creates a new KDbTableOrQuerySchema variant object, retrieving table or query schema using conn connection and name. If type is Table, name is assumed to be a table name, otherwise name is assumed to be a query name. Check whether a query or table has been found by testing (query() || table()) expression.

Since
3.1

Definition at line 54 of file KDbTableOrQuerySchema.cpp.

◆ KDbTableOrQuerySchema() [3/6]

KDbTableOrQuerySchema::KDbTableOrQuerySchema ( KDbFieldList * tableOrQuery)
explicit

Creates a new KDbTableOrQuerySchema variant object. tableOrQuery should be of class KDbTableSchema or KDbQuerySchema. Check whether a query or table has been found by testing (query() || table()) expression.

Definition at line 68 of file KDbTableOrQuerySchema.cpp.

◆ KDbTableOrQuerySchema() [4/6]

KDbTableOrQuerySchema::KDbTableOrQuerySchema ( KDbConnection * conn,
int id )

Creates a new KDbTableOrQuerySchema variant object, retrieving table or query schema using conn connection and id. Check whether a query or table has been found by testing (query() || table()) expression.

Definition at line 78 of file KDbTableOrQuerySchema.cpp.

◆ KDbTableOrQuerySchema() [5/6]

KDbTableOrQuerySchema::KDbTableOrQuerySchema ( KDbTableSchema * table)
explicit

Creates a new KDbTableOrQuerySchema variant object, keeping a pointer to table object.

Definition at line 88 of file KDbTableOrQuerySchema.cpp.

◆ KDbTableOrQuerySchema() [6/6]

KDbTableOrQuerySchema::KDbTableOrQuerySchema ( KDbQuerySchema * query)
explicit

Creates a new KDbTableOrQuerySchema variant object, keeping a pointer to query object.

Definition at line 98 of file KDbTableOrQuerySchema.cpp.

◆ ~KDbTableOrQuerySchema()

KDbTableOrQuerySchema::~KDbTableOrQuerySchema ( )

Definition at line 108 of file KDbTableOrQuerySchema.cpp.

Member Function Documentation

◆ captionOrName()

QString KDbTableOrQuerySchema::captionOrName ( ) const
Returns
caption (if present) or name of the table/query

Definition at line 147 of file KDbTableOrQuerySchema.cpp.

◆ columnInfo()

KDbQueryColumnInfo * KDbTableOrQuerySchema::columnInfo ( KDbConnection * conn,
const QString & name )

Like KDbField* field(const QString& name); but returns all information associated with field/column name.

Definition at line 165 of file KDbTableOrQuerySchema.cpp.

◆ columns()

const KDbQueryColumnInfo::Vector KDbTableOrQuerySchema::columns ( KDbConnection * conn,
ColumnsMode mode = ColumnsMode::NonUnique )
Returns
all columns for the table or the query

Definition at line 122 of file KDbTableOrQuerySchema.cpp.

◆ field()

KDbField * KDbTableOrQuerySchema::field ( const QString & name)
Returns
a field of the table or the query schema for name name or 0 if there is no such field.

Definition at line 155 of file KDbTableOrQuerySchema.cpp.

◆ fieldCount()

int KDbTableOrQuerySchema::fieldCount ( KDbConnection * conn) const

Returns number of columns within record set returned from specified table or query.

In case of query expanded fields list is counted. For tables conn is not required. Returns -1 if the object has neither table or query assigned. Returns -1 if the object has query assigned but conn is nullptr.

Definition at line 113 of file KDbTableOrQuerySchema.cpp.

◆ name()

QByteArray KDbTableOrQuerySchema::name ( ) const
Returns
name of a query or table

Definition at line 138 of file KDbTableOrQuerySchema.cpp.

◆ query()

KDbQuerySchema * KDbTableOrQuerySchema::query ( ) const
Returns
a pointer to the query if it's provided

Definition at line 188 of file KDbTableOrQuerySchema.cpp.

◆ table()

KDbTableSchema * KDbTableOrQuerySchema::table ( ) const
Returns
a pointer to the table if it's provided

Definition at line 193 of file KDbTableOrQuerySchema.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 11:54:31 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.