Kexi API Documentation (2.0 alpha)

KexiDB::DriverBehaviour Class Reference

#include <driver_p.h>

List of all members.


Detailed Description

Detailed definition of driver's default behaviour. Note for driver developers: Change these defaults in you Driver subclass constructor, if needed.

Definition at line 47 of file driver_p.h.

Public Member Functions

 DriverBehaviour ()

Public Attributes

QString UNSIGNED_TYPE_KEYWORD
 "UNSIGNED" by default
QString AUTO_INCREMENT_FIELD_OPTION
 "AUTO_INCREMENT" by default, used as add-in word to field definition May be also used as full definition if SPECIAL_AUTO_INCREMENT_DEF is true.
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 full definition if SPECIAL_AUTO_INCREMENT_DEF is true.
QString AUTO_INCREMENT_TYPE
 "" by default, used as type string for autoinc.
bool SPECIAL_AUTO_INCREMENT_DEF: 1
bool AUTO_INCREMENT_REQUIRES_PK: 1
QString ROW_ID_FIELD_NAME
bool ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE: 1
QString ALWAYS_AVAILABLE_DATABASE_NAME
QChar QUOTATION_MARKS_FOR_IDENTIFIER
bool USING_DATABASE_REQUIRED_TO_CONNECT: 1
bool _1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY: 1
bool SELECT_1_SUBQUERY_SUPPORTED: 1
const char ** SQL_KEYWORDS


Constructor & Destructor Documentation

DriverBehaviour::DriverBehaviour  ) 
 

Definition at line 47 of file driver.cpp.


Member Data Documentation

bool KexiDB::DriverBehaviour::_1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY
 

True if before we know whether the fetched result of executed query is empty or not, we need to fetch first record. Particularly, it's true for SQLite. The flag is used in Cursor::open(). By default this flag is false.

Definition at line 130 of file driver_p.h.

Referenced by KexiDB::SQLiteDriver::SQLiteDriver().

QString KexiDB::DriverBehaviour::ALWAYS_AVAILABLE_DATABASE_NAME
 

Name of any (e.g. first found) database for this connection that typically always exists. This can be not set if we want to do some magic checking what database name is availabe by reimplementing Connection::anyAvailableDatabaseName(). Example: for PostgreSQL this is "template1".

See also:
Connection::SetAvailableDatabaseName()

Definition at line 112 of file driver_p.h.

Referenced by KexiDB::Connection::anyAvailableDatabaseName().

QString KexiDB::DriverBehaviour::AUTO_INCREMENT_FIELD_OPTION
 

"AUTO_INCREMENT" by default, used as add-in word to field definition May be also used as full definition if SPECIAL_AUTO_INCREMENT_DEF is true.

Definition at line 57 of file driver_p.h.

Referenced by KexiDB::Connection::createTableStatement(), and KexiDB::SQLiteDriver::SQLiteDriver().

QString KexiDB::DriverBehaviour::AUTO_INCREMENT_PK_FIELD_OPTION
 

"AUTO_INCREMENT PRIMARY KEY" by default, used as add-in word to field definition May be also used as full definition if SPECIAL_AUTO_INCREMENT_DEF is true.

Definition at line 61 of file driver_p.h.

Referenced by KexiDB::Connection::createTableStatement(), and KexiDB::SQLiteDriver::SQLiteDriver().

bool KexiDB::DriverBehaviour::AUTO_INCREMENT_REQUIRES_PK
 

True if autoincrement requires field to be declared as primary key. This is true for SQLite. False by default.

Definition at line 75 of file driver_p.h.

Referenced by KexiDB::Connection::createTableStatement(), and KexiDB::SQLiteDriver::SQLiteDriver().

QString KexiDB::DriverBehaviour::AUTO_INCREMENT_TYPE
 

"" by default, used as type string for autoinc.

field definition pgsql defines it as "SERIAL", sqlite defines it as "INTEGER"

Definition at line 65 of file driver_p.h.

Referenced by KexiDB::Connection::createTableStatement(), and KexiDB::SQLiteDriver::SQLiteDriver().

QChar KexiDB::DriverBehaviour::QUOTATION_MARKS_FOR_IDENTIFIER
 

Quotation marks used for escaping identifier (see Driver::escapeIdentifier()). Default value is '"'. Change it for your driver.

Definition at line 117 of file driver_p.h.

Referenced by KexiDB::Driver::escapeIdentifier(), and KexiDB::SQLiteDriver::SQLiteDriver().

QString KexiDB::DriverBehaviour::ROW_ID_FIELD_NAME
 

Name of a field (or built-in function) with autoincremented unique value, typically returned by Connection::drv_lastInsertRowID().

Examples:

  • PostgreSQL and SQLite engines use 'OID' field
  • MySQL uses LAST_INSERT_ID() built-in function

Definition at line 84 of file driver_p.h.

Referenced by KexiDB::Connection::deleteRow(), KexiDB::Driver::isSystemFieldName(), KexiDB::Connection::lastInsertedAutoIncValue(), KexiDB::Connection::selectStatement(), KexiDB::SQLiteDriver::SQLiteDriver(), and KexiDB::Connection::updateRow().

bool KexiDB::DriverBehaviour::ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE
 

True if the value (fetched from field or function, defined by ROW_ID_FIELD_NAME member) is EXACTLY the value of autoincremented field, not an implicit (internal) row number. Default value is false.

Examples:

  • PostgreSQL and SQLite engines have this flag set to false ('OID' field has it's own implicit value)
  • MySQL engine has this flag set to true (LAST_INSERT_ID() returns real value of last autoincremented field).

Notes: If it's false, we have a convenient way for identifying row even when there's no primary key defined. So, as '_ROWID' column in MySQL is really just a synonym for the primary key, this engine needs to have primary keys always defined if we want to use interactive editing features like row updating and deleting.

Definition at line 102 of file driver_p.h.

Referenced by KexiDB::Connection::insertRow(), and KexiDB::Connection::lastInsertedAutoIncValue().

bool KexiDB::DriverBehaviour::SELECT_1_SUBQUERY_SUPPORTED
 

True if "SELECT 1 from (subquery)" is supported. False by default. Used in Connection::resultExists() for optimization. It's set to true for SQLite driver.

Definition at line 134 of file driver_p.h.

Referenced by KexiDB::Connection::resultExists(), and KexiDB::SQLiteDriver::SQLiteDriver().

bool KexiDB::DriverBehaviour::SPECIAL_AUTO_INCREMENT_DEF
 

True if autoincrement field has special definition e.g. like "INTEGER PRIMARY KEY" for SQLite. Special definition string should be stored in AUTO_INCREMENT_FIELD_OPTION. False by default.

Definition at line 71 of file driver_p.h.

Referenced by KexiDB::Connection::createTableStatement(), and KexiDB::SQLiteDriver::SQLiteDriver().

const char** KexiDB::DriverBehaviour::SQL_KEYWORDS
 

Keywords that need to be escaped for the driver. Set this before calling Driver::initSQLKeywords.

Definition at line 138 of file driver_p.h.

Referenced by KexiDB::Driver::initSQLKeywords(), and KexiDB::SQLiteDriver::SQLiteDriver().

QString KexiDB::DriverBehaviour::UNSIGNED_TYPE_KEYWORD
 

"UNSIGNED" by default

Definition at line 53 of file driver_p.h.

Referenced by KexiDB::Connection::createTableStatement().

bool KexiDB::DriverBehaviour::USING_DATABASE_REQUIRED_TO_CONNECT
 

True if using database is requied to perform real connection. This is true for may engines, e.g. for PostgreSQL, where connections string should contain a database name. This flag is unused for file-based db drivers, by default set to true and used for all other db drivers.

Definition at line 125 of file driver_p.h.

Referenced by KexiDB::Connection::useTemporaryDatabaseIfNeeded().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:50:40 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003