Public Types
- class Capability
- class Connector
- class Connection
- typedef QList<Connection> ConnectionList
- typedef QListIterator<Connection> ConnectionIterator
- class Exception
- class Handler
- class Table
- class Field
- class Query
- class Control
- class Database
- typedef QList<Database> DatabaseList
- typedef QListIterator<Database> DatabaseIterator
- class DataObject
- class DBEngine
- class PluginException
- class PluginNotFound
- class LibraryError
- class UnsupportedCapability
- class DataException
- class ConversionException
- class ServerError
- class ObjectNotFound
- class SQLError
- class InvalidRequest
- class ConnectionException
- class HostNotFound
- class InvalidLogin
- typedef QList<Field> FieldList
- typedef QListIterator<Field> FieldIterator
- typedef KSharedPtr<Handler> HandlerPtr
- class Index
- typedef QList<Index> IndexList
- typedef QListIterator<Index> IndexIterator
- typedef QValueList< Value > Row
- typedef QValueList< KDB::Row > RowList
- enum DataType { UNKNOWN = -1,
CHAR,
VARCHAR,
SMALLINT,
INT,
BIGINT,
FLOAT,
DOUBLE,
DATE,
TIME,
TIMESTAMP,
SET,
ENUM,
ARRAY,
BLOB
}
- enum capability { TRANSACTIONS,
REORG,
STOPROCS,
VIEWS,
ADMIN,
SEQUENCES,
FUNCTIONS,
CONFIG
}
- class Object
- class Plugin
- typedef QList<Plugin> PluginList
- typedef QListIterator<Plugin> PluginIterator
- class Recordset
- typedef KSharedPtr<Query> QueryPtr
- typedef QValueList<QueryPtr> QueryList
- typedef QValueListIterator<QueryPtr> QueryIterator
- typedef QMap<QString,QString> ParameterList
- struct qryField
- typedef QList<qryField> FldList
- typedef QListIterator<qryField> FldIterator
- struct qryCond
- typedef QList<qryCond> CondList
- typedef QListIterator<qryCond> CondIterator
- class Record
- typedef KSharedPtr<Record> RecordPtr
- typedef KSharedPtr<Recordset> RecordsetPtr
- class RecordsetIterator
- typedef KSharedPtr<Table> TablePtr
- typedef QValueList<TablePtr> TableList
- typedef QValueListIterator<TablePtr> TableIterator
- typedef KSharedPtr<Recordset> RecordsetPtr
Public Members
Capability (class) | Capability |
base class for all Capabilities implemented by a plugin
Connector (class) | Connector |
This is the base class for the interaction between kdbcore and
the various plugins. It should be subclassed by plugins, but should
not be used by the client programs
Connection (class) | Connection |
Manages the connection state to a SQL engine.
Basically stores all authentication tokens and
opens/closes connection as needed.
It is also a collection of database objects, allowing
- traversal of all databases (DatabaseIterator and databases )
- retrieval by name (findDatabase )
- creation of new databases (createDatabase )
typedef QList<Connection> ConnectionList | ConnectionList |
typedef QListIterator<Connection> ConnectionIterator | ConnectionIterator |
Exception (class) | Exception |
this class represents and exceptional condition
of the library. The type of exceptional condition
depends on the subclasses of this class
will contain the handler to a set of records
Representation of a database table.
Trough this object we access the fields and
indices of a given table (when available). This object will allow building of
new fields and indexes, as well as editing of the table data using
openRecordset
Representation of a field object.
It knows its name, its datatype, constraints
when available (like null/not null) and, when it is part of a record, its value.
The field object can manage only the data type of the underlying column.
Conversion operators are provided for all common C++ datatypes. If a conversion
is not allowed, a KDB::ConversionException is raised.
It is responsibility of the plugin to instantiate a correct field object for
the underlying datatype. For datatypes not supported natively by C++, the
Plugin can handle either QStrings or QByteArrays.
The datatype supported are the following:
- QString (can be used for unknown datatypes)
- QStringList (for sets and one-dimensional array)
- QDateTime
- QByteArray (for BLOBs and Unknown datatypes)
- char
- short
- int
- long
- float
- double
- long double
- bool
All numeric types are handled both in signed and unsigned form.
Representation of a stored query.
Through this object we access the fields and
parameters of the query, if any.
Each query is stored in the database as an XML definition. This definition
will contain the list of fields, calculated fields (not implemented yet), tables, filters - join
expressions and parameters. One exception to that is done when the query is built
using an SQL expression in Database::newQuery . In this case, the SQL is stored.
Queries are of two types: select queries and command queries. Select queries can
be used to obtain a recordset using openRecordset , while command queries are
executed using execute . Command queries have different types: Update, Insert,
Delete. By default, a newly built query is a Select query. You can change the query
type using setType
Queries can be parametrized. While building the query,
the user can use the special construct %name, and provide a
corresponding value using the setParameter call. Before the execution (through
openRecordset or execute ), a parameter substitution is done. When there is no
corresponding parameter value, the %xxx keyword is removed. This can lead to incorrect
SQL. Parameter substitution is done on the complete SQL statement, allowing creation
of queries that access data with similar definition in different tables with only one
query definition.
base class for control dialog extension. All plugins that
need a specific configuration dialog in the KControl module must
provide a subclass of this class.
Central access point to all functionality of the single database.
That means it provides a list of all queries and tables, and is able to execute
a command query and to return a recordset for a given query.
Tables and queries can be accessed by name, and the class can
provide collection objects for both.
typedef QList<Database> DatabaseList | DatabaseList |
DataObject (class) | DataObject |
Base class for all 'real' data access objects.
It mostly provide shared support (with automatic deallocation)
It inherits from KShared.
Table, Query and Recordset are DatabaseObject.
Entry point for the library.
This object manages all available plugins, and can create connections to
servers or databases.
In more detail:
- On first reference, loads all plugins registered in $KDEDIR/share/services.
- Allows iterations through all available plugins.
- Provide functions to directly access connections and databases through openDatabase
and openConnection
PluginException (class) | PluginException |
PluginNotFound (class) | PluginNotFound |
LibraryError (class) | LibraryError |
UnsupportedCapability (class) | UnsupportedCapability |
DataException (class) | DataException |
ConversionException (class) | ConversionException |
ServerError (class) | ServerError |
ObjectNotFound (class) | ObjectNotFound |
InvalidRequest (class) | InvalidRequest |
ConnectionException (class) | ConnectionException |
HostNotFound (class) | HostNotFound |
InvalidLogin (class) | InvalidLogin |
typedef QList<Field> FieldList | FieldList |
This class should provide information for an index of a table
Things such fields involved, ordering, if primary or not and so on.
typedef QList<Index> IndexList | IndexList |
enum DataType { UNKNOWN = -1,
CHAR,
VARCHAR,
SMALLINT,
INT,
BIGINT,
FLOAT,
DOUBLE,
DATE,
TIME,
TIMESTAMP,
SET,
ENUM,
ARRAY,
BLOB
}
| DataType |
These are all the datatypes natively supported
by libkdbcore. Conversion to and from QT/C++ native types
is provided by the library.
See KDB::Field for further details on kdbcore type system
enum capability { TRANSACTIONS,
REORG,
STOPROCS,
VIEWS,
ADMIN,
SEQUENCES,
FUNCTIONS,
CONFIG
}
| capability |
These are all currently known capabilities of a DBMS that a
plugin can support. Plugins are queryable about the supported
capabilities through KDB::Plugin::provides and implementations
are available through KDB::Plugin::createObject
Base class for all KDB objects.
It inherits QObject and provide base
error reporting
A Plugin handles all connections related to a DBMS (Postgres, MySQL, and so on).
This class allows traversal of the list of available connections, and can
be queried about general informations and implemented capabilities through provides
The Plugin is also responsible of creating "capability objects", that is
objects that can implement a specific capabilities.
Actually we have found the following capabilities:
- Transactions (does not have a "capability object")
- Reorganization, that is the ability of 'compressing' database objects after
a big number of deletes (does not have a "capability object")
- Stored procedures
- Administration
- Users and Groups (ACL)
- Views
- Sequences
- User defined functions
typedef QList<Plugin> PluginList | PluginList |
Recordset (class) | Recordset |
A set of records, that can be traversed through iterators.
A recordset can be obtained directly by the database (through
KDB::Database::openRecordset ("Select * from blah") ) or from an
existing table or query.
There are two types of recordsets: read only or updatable. the type can
be queried through updatable
an updatable recordset can be asked to build new records, as well as delete
existing ones. Updates are allowed in the KDB::Record class
qryField (struct) | qryField |
typedef QList<qryField> FldList | FldList |
typedef QList<qryCond> CondList | CondList |
A collection of fields with relevant values.
The fields should be accessed like an associative array:
rec["field1"] = "value";
or
rec[1] = "value";
|
there are two record types: updatable and read only, depending on the
parent recordset
typedef KSharedPtr<Recordset> RecordsetPtr | RecordsetPtr |
RecordsetIterator (class) | RecordsetIterator |
This is an iterator over a recordset.
It can be used to access all records of a recordset
either sequentialy or randomly.
typedef KSharedPtr<Recordset> RecordsetPtr | RecordsetPtr |
Generated by: root@powerpc.ports.openbsd.org on Tue Apr 24 23:01:57 2001, using kdoc 2.0a53. |