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

 ~Database ()

~Database

[virtual]

TablePtr  newTable (const QString &name)

newTable

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)

getTable

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

TableList  tables (bool system = false)

tables

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)

tableNames

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)

removeTable

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)

newQuery

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)

getQuery

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

QueryList  queries ()

queries

return the list of available queries

QStringList  queryNames ()

queryNames

return the list of names of available queries

bool  removeQuery (const QString &name)

removeQuery

removes a query from the database.

RecordsetPtr  openRecordset (const QString &SQL)

openRecordset

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)

execute

exec a command query. returns the number of records affected

bool  open ()

open

void  close ()

close

bool  isOpen ()

isOpen

void  tableAdded ( QString )

tableAdded

[signal]

void  tableRemoved ( QString )

tableRemoved

[signal]

void  queryAdded ( QString )

queryAdded

[signal]

void  queryRemoved ( QString )

queryRemoved

[signal]

void  changed ()

changed

[signal]

void  closed ()

closed

[signal]

void  opened ()

opened

[signal]

void  tableCreated ( KDB::Table * )

tableCreated

[protected slots slot]