class Database

Central access point to all functionality of the single database. More...

Full nameKDB::Database
Definition#include <database.h>
InheritsKDB::Object [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Signals

Protected Slots


Detailed Description

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.

 Database (const Database & base)

 ~Database ()

[virtual]

TablePtr  newTable (const QString &name)

creates a new table for the current database. please note that the table is not yet part of the database until you call KDB::Table::create

TablePtr  getTable (const QString &name)

returns an existing table by name, or 0L if the table does not exists

TableList  tables (bool system = false)

return the list of available tables. tables whose name begins with "__" ( so called system tables) will be returned only if system = true

QStringList  tableNames (bool system = false)

return a list of names of available tables. tables whose name begins with "__" ( so called system tables) will be returned only if system = true

bool  removeTable (const QString &name)

removes a table from the database. This means that the table is dropped, and all the content is erased

QueryPtr  newQuery (const QString &name, const QString &SQL = QString::null)

creates a new query

Parameters:
namethis is the name of the query
SQLthis is the sql executed by the query. if it is not given, the query can be built with addTable, addField and so on

QueryPtr  getQuery (const QString &name)

returns an existing query by name, or 0L if the query does not exists

QueryList  queries ()

return the list of available queries

QStringList  queryNames ()

return the list of names of available queries

bool  removeQuery (const QString &name)

removes a query from the database.

RecordsetPtr  openRecordset (const QString &SQL)

creates a recordset based on a given query. if the query fails, 0L is returned. you can then check errorMessage() to get a specific error message

KDB_ULONG  execute (const QString &SQL)

exec a command query. returns the number of records affected

bool  open ()

void  close ()

bool  isOpen ()

void  tableAdded ( QString )

[signal]

void  tableRemoved ( QString )

[signal]

void  queryAdded ( QString )

[signal]

void  queryRemoved ( QString )

[signal]

void  changed ()

[signal]

void  closed ()

[signal]

void  opened ()

[signal]

void  tableCreated ( KDB::Table * )

[ protected slots: slot]