Kexi API Documentation (2.0 alpha)

KexiDB::Cursor Class Reference

#include <cursor.h>

Inheritance diagram for KexiDB::Cursor:

KexiDB::Object KexiDB::MySqlCursor KexiDB::pqxxSqlCursor KexiDB::SQLiteCursor List of all members.

Detailed Description

Provides database cursor functionality.

Cursor can be defined in two ways:

  1. by passing QuerySchema object to Connection::executeQuery() or Connection::prepareQuery(); then query is defined for in engine-independent way -- this is recommended usage

  1. by passing raw query statement string to Connection::executeQuery() or Connection::prepareQuery(); then query may be defined for in engine-dependent way -- this is not recommended usage, but convenient when we can't or do not want to allocate QuerySchema object, while we know that the query statement is syntactically and logically ok in our context.

You can move cursor to next record with moveNext() and move back with movePrev(). The cursor is always positioned on record, not between records, with exception that ofter open() it is positioned before first record (if any) -- then bof() equals true, and can be positioned after the last record (if any) with moveNext() -- then eof() equals true, For example, if you have four records 1, 2, 3, 4, then after calling moveNext(), moveNext(), moveNext(), movePrev() you are going through records: 1, 2, 3, 2.

Cursor can be buffered or unbuferred. Buffering in this class is not related to any SQL engine capatibilities for server-side cursors (eg. like 'DECLARE CURSOR' statement) - buffered data is at client (application) side. Any record retrieved in buffered cursor will be stored inside an internal buffer and reused when needed. Unbuffered cursor always requires one record fetching from db connection at every step done with moveNext(), movePrev(), etc.

Notes:

Definition at line 66 of file cursor.h.

Public Types

enum  Options { NoOptions = 0, Buffered = 1 }
 Cursor options that describes its behaviour. More...

Public Member Functions

virtual ~Cursor ()
Connectionconnection () const
bool open ()
bool reopen ()
virtual bool close ()
QuerySchemaquery () const
QValueList< QVariant > queryParameters () const
void setQueryParameters (const QValueList< QVariant > &params)
 Sets query parameters params for this cursor.
QString rawStatement () const
uint options () const
bool isOpened () const
bool isBuffered () const
void setBuffered (bool buffered)
bool moveFirst ()
virtual bool moveLast ()
virtual bool moveNext ()
virtual bool movePrev ()
bool eof () const
bool bof () const
Q_LLONG at () const
uint fieldCount () const
bool containsROWIDInfo () const
virtual QVariant value (uint i)=0
virtual const char ** rowData () const =0
void setOrderByColumnList (const QStringList &columnNames)
void setOrderByColumnList (const QString &column1, const QString &column2=QString::null, const QString &column3=QString::null, const QString &column4=QString::null, const QString &column5=QString::null)
QueryColumnInfo::Vector orderByColumnList () const
virtual void storeCurrentRow (RowData &data) const =0
bool updateRow (RowData &data, RowEditBuffer &buf, bool useROWID=false)
bool insertRow (RowData &data, RowEditBuffer &buf, bool getROWID=false)
bool deleteRow (RowData &data, bool useROWID=false)
bool deleteAllRows ()
virtual int serverResult ()
virtual QString serverResultName ()
virtual QString serverErrorMsg ()
QString debugString () const
void debug () const
 Outputs debug information.

Protected Types

enum  FetchResult { FetchError = 0, FetchOK = 1, FetchEnd = 2 }
 possible results of row fetching, used for m_result More...

Protected Member Functions

 Cursor (Connection *conn, const QString &statement, uint options=NoOptions)
 Cursor (Connection *conn, QuerySchema &query, uint options=NoOptions)
void init ()
bool getNextRecord ()
virtual bool drv_open ()=0
virtual bool drv_close ()=0
virtual void drv_getNextRecord ()=0
virtual void drv_appendCurrentRecordToBuffer ()=0
virtual void drv_bufferMovePointerNext ()=0
virtual void drv_bufferMovePointerPrev ()=0
virtual void drv_bufferMovePointerTo (Q_LLONG at)=0
virtual void drv_clearBuffer ()
void clearBuffer ()
virtual void drv_clearServerResult ()=0

Protected Attributes

QGuardedPtr< Connectionm_conn
QuerySchemam_query
QString m_rawStatement
bool m_opened: 1
bool m_atLast: 1
bool m_afterLast: 1
bool m_validRecord: 1
 true if valid record is currently retrieved @ current position
bool m_containsROWIDInfo: 1
Q_LLONG m_at
uint m_fieldCount
 cached field count information
uint m_logicalFieldCount
 logical field count, i.e. without intrernal values like ROWID or lookup
uint m_options
 cursor options that describes its behaviour
char m_result
 result of a row fetching
int m_records_in_buf
 number of records currently stored in the buffer
bool m_buffering_completed: 1
 true if we already have all records stored in the buffer
QueryColumnInfo::Vectorm_fieldsExpanded
 Useful e.g. for value(int) method when we need access to schema def.
QueryColumnInfo::Vectorm_orderByColumnList
 Used by setOrderByColumnList().
QValueList< QVariant > * m_queryParameters


Member Enumeration Documentation

enum KexiDB::Cursor::FetchResult [protected]
 

possible results of row fetching, used for m_result

Enumeration values:
FetchError 
FetchOK 
FetchEnd 

Definition at line 256 of file cursor.h.

enum KexiDB::Cursor::Options
 

Cursor options that describes its behaviour.

Enumeration values:
NoOptions 
Buffered 

Definition at line 72 of file cursor.h.


Constructor & Destructor Documentation

Cursor::~Cursor  )  [virtual]
 

Definition at line 107 of file cursor.cpp.

References KexiDBDbg, m_conn, m_fieldsExpanded, m_query, m_queryParameters, and m_rawStatement.

Cursor::Cursor Connection conn,
const QString statement,
uint  options = NoOptions
[protected]
 

Cursor will operate on conn, raw statement will be used to execute query.

Definition at line 40 of file cursor.cpp.

References init().

Cursor::Cursor Connection conn,
QuerySchema query,
uint  options = NoOptions
[protected]
 

Cursor will operate on conn, query schema will be used to execute query.

Definition at line 53 of file cursor.cpp.

References KexiDB::QuerySchema::debugString(), init(), and KexiDB::SchemaData::name().


Member Function Documentation

Q_LLONG Cursor::at  )  const
 

Returns:
current internal position of the cursor's query. We are counting records from 0. Value -1 means that cursor does not point to any valid record (this happens eg. after open(), close(), and after moving after last record or before first one.

Definition at line 349 of file cursor.cpp.

References m_at.

Referenced by debugString(), KexiDB::pqxxSqlCursor::drv_getNextRecord(), KexiDB::MySqlCursor::drv_getNextRecord(), KexiDB::pqxxSqlCursor::drv_getPrevRecord(), KexiDB::pqxxSqlCursor::rowData(), and KexiDB::SQLiteCursor::storeCurrentRow().

bool Cursor::bof  )  const
 

Returns:
true if current position is before first record.

Definition at line 344 of file cursor.cpp.

References m_at.

Referenced by KexiUserAction::fromCurrentRecord().

void Cursor::clearBuffer  )  [protected]
 

Definition at line 370 of file cursor.cpp.

References drv_clearBuffer(), isBuffered(), m_fieldCount, and m_records_in_buf.

Referenced by close().

bool Cursor::close  )  [virtual]
 

Closes previously opened cursor. If the cursor is closed, nothing happens.

Definition at line 178 of file cursor.cpp.

References clearBuffer(), drv_close(), m_afterLast, m_at, m_fieldCount, m_logicalFieldCount, and m_opened.

Referenced by open(), reopen(), KexiDB::MySqlCursor::~MySqlCursor(), KexiDB::pqxxSqlCursor::~pqxxSqlCursor(), and KexiDB::SQLiteCursor::~SQLiteCursor().

Connection* KexiDB::Cursor::connection  )  const [inline]
 

Returns:
connection used for the cursor

Definition at line 80 of file cursor.h.

Referenced by KexiDB::pqxxSqlCursor::drv_open(), and KexiQueryView::executeQuery().

bool KexiDB::Cursor::containsROWIDInfo  )  const [inline]
 

Returns:
true if ROWID information is appended with every row. ROWID information is available if DriverBehaviour::ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE == false for a KexiDB database driver and the master table has no primary key defined. Phisically, ROWID value is returned after last returned field, so data vector's length is expanded by one.

Definition at line 172 of file cursor.h.

void Cursor::debug  )  const
 

Outputs debug information.

Definition at line 524 of file cursor.cpp.

References debugString(), and KexiDBDbg.

Referenced by KexiDataTableView::setData().

QString Cursor::debugString  )  const
 

Returns:
Debug information.

Definition at line 497 of file cursor.cpp.

References at(), isBuffered(), isOpened(), m_conn, and m_rawStatement.

Referenced by debug().

bool Cursor::deleteAllRows  ) 
 

Todo:
doesn't update cursor's buffer YET!

Definition at line 488 of file cursor.cpp.

References KexiDB::Object::clearError(), m_conn, and m_query.

bool Cursor::deleteRow RowData data,
bool  useROWID = false
 

Todo:
doesn't update cursor's buffer YET!

Definition at line 479 of file cursor.cpp.

References KexiDB::Object::clearError(), m_conn, and m_query.

virtual void KexiDB::Cursor::drv_appendCurrentRecordToBuffer  )  [protected, pure virtual]
 

Stores currently fetched record's values in appropriate place of the buffer. Note for driver developers: This place can be computed using m_at. Do not change value of m_at or any other Cursor members, only change your internal structures like pointer to current row, etc. If your database engine's API function (for record fetching) do not allocates such a space, you want to allocate a space for current record. Otherwise, reuse existing structure, what could be more efficient. All functions like drv_appendCurrentRecordToBuffer() operates on the buffer, i.e. array of stored rows. You are not forced to have any particular fixed structure for buffer item or buffer itself - the structure is internal and only methods like storeCurrentRecord() visible to public.

Implemented in KexiDB::MySqlCursor, KexiDB::pqxxSqlCursor, and KexiDB::SQLiteCursor.

Referenced by getNextRecord().

virtual void KexiDB::Cursor::drv_bufferMovePointerNext  )  [protected, pure virtual]
 

Moves pointer (that points to the buffer) -- to next item in this buffer. Note for driver developers: probably just execute "your_pointer++" is enough.

Implemented in KexiDB::MySqlCursor, KexiDB::pqxxSqlCursor, and KexiDB::SQLiteCursor.

Referenced by getNextRecord().

virtual void KexiDB::Cursor::drv_bufferMovePointerPrev  )  [protected, pure virtual]
 

Like drv_bufferMovePointerNext() but execute "your_pointer--".

Implemented in KexiDB::MySqlCursor, KexiDB::pqxxSqlCursor, and KexiDB::SQLiteCursor.

Referenced by movePrev().

virtual void KexiDB::Cursor::drv_bufferMovePointerTo Q_LLONG  at  )  [protected, pure virtual]
 

Moves pointer (that points to the buffer) to a new place: at.

Implemented in KexiDB::MySqlCursor, KexiDB::pqxxSqlCursor, and KexiDB::SQLiteCursor.

Referenced by getNextRecord(), and movePrev().

virtual void KexiDB::Cursor::drv_clearBuffer  )  [inline, protected, virtual]
 

Clears cursor's buffer if this was allocated (only for buffered cursor type). Otherwise do nothing. For reimplementing. Default implementation does nothing.

Reimplemented in KexiDB::SQLiteCursor.

Definition at line 312 of file cursor.h.

Referenced by clearBuffer().

virtual void KexiDB::Cursor::drv_clearServerResult  )  [protected, pure virtual]
 

Clears an internal member that is used to storing last result code, the same that is returend by serverResult().

Reimplemented from KexiDB::Object.

Implemented in KexiDB::MySqlCursor, KexiDB::pqxxSqlCursor, and KexiDB::SQLiteCursor.

virtual bool KexiDB::Cursor::drv_close  )  [protected, pure virtual]
 

Implemented in KexiDB::MySqlCursor, KexiDB::pqxxSqlCursor, and KexiDB::SQLiteCursor.

Referenced by close().

virtual void KexiDB::Cursor::drv_getNextRecord  )  [protected, pure virtual]
 

Implemented in KexiDB::MySqlCursor, KexiDB::pqxxSqlCursor, and KexiDB::SQLiteCursor.

Referenced by getNextRecord().

virtual bool KexiDB::Cursor::drv_open  )  [protected, pure virtual]
 

Implemented in KexiDB::MySqlCursor, KexiDB::pqxxSqlCursor, and KexiDB::SQLiteCursor.

Referenced by open().

bool Cursor::eof  )  const
 

Returns:
true if current position is after last record.

Definition at line 339 of file cursor.cpp.

References m_afterLast.

Referenced by KexiPart::Manager::checkProject(), KexiDB::SQLiteConnection::drv_getTablesList(), KexiDB::pqxxSqlConnection::drv_getTablesList(), KexiDB::MySqlConnection::drv_getTablesList(), KexiUserAction::fromCurrentRecord(), KexiProject::items(), KexiCSVExport::exportData(), KexiDB::Connection::objectIds(), KexiDB::Connection::objectNames(), KexiDB::Connection::querySingleRecordInternal(), KexiDB::Connection::querySingleString(), KexiDB::Connection::queryStringList(), KexiDB::Connection::resultExists(), and KexiDB::Connection::setupTableSchema().

uint KexiDB::Cursor::fieldCount  )  const [inline]
 

Returns:
number of fields available for this cursor. This never includes ROWID column or other internal coluns (e.g. lookup).

Definition at line 164 of file cursor.h.

Referenced by KexiDB::Connection::checkIfColumnExists(), KexiCSVExport::exportData(), and KexiDataTableView::setData().

bool Cursor::getNextRecord  )  [protected]
 

Internal: cares about proper flag setting depending on result of drv_getNextRecord() and depending on wherher a cursor is buffered.

Definition at line 381 of file cursor.cpp.

References Buffered, drv_appendCurrentRecordToBuffer(), drv_bufferMovePointerNext(), drv_bufferMovePointerTo(), drv_getNextRecord(), ERR_CURSOR_RECORD_FETCHING, FetchEnd, FetchOK, m_afterLast, m_at, m_buffering_completed, m_options, m_records_in_buf, m_result, m_validRecord, and KexiDB::Object::setError().

Referenced by moveFirst(), moveLast(), moveNext(), and open().

void Cursor::init  )  [protected]
 

Definition at line 65 of file cursor.cpp.

References m_afterLast, m_at, m_atLast, m_buffering_completed, m_conn, m_containsROWIDInfo, m_fieldCount, m_fieldsExpanded, m_logicalFieldCount, m_opened, m_orderByColumnList, m_query, m_queryParameters, m_records_in_buf, m_result, KexiDB::QuerySchema::masterTable(), KexiDB::QuerySchema::WithInternalFields, and KexiDB::QuerySchema::WithInternalFieldsAndRowID.

Referenced by Cursor().

bool Cursor::insertRow RowData data,
RowEditBuffer buf,
bool  getROWID = false
 

Todo:
doesn't update cursor's buffer YET!

Definition at line 470 of file cursor.cpp.

References KexiDB::Object::clearError(), m_conn, and m_query.

bool Cursor::isBuffered  )  const
 

Returns:
true if the cursor is buffered.

Definition at line 356 of file cursor.cpp.

References Buffered, and m_options.

Referenced by clearBuffer(), debugString(), KexiDB::SQLiteCursor::drv_open(), and setBuffered().

bool KexiDB::Cursor::isOpened  )  const [inline]
 

Returns:
true if the cursor is opened.

Definition at line 120 of file cursor.h.

Referenced by debugString(), and KexiDataTableView::setData().

bool Cursor::moveFirst  ) 
 

Moves current position to the first record and retrieves it.

Returns:
true if the first record was retrieved. False could mean that there was an error or there is no record available.

Definition at line 205 of file cursor.cpp.

References Buffered, getNextRecord(), m_afterLast, m_at, m_buffering_completed, m_opened, m_options, m_records_in_buf, m_validRecord, and reopen().

Referenced by KexiPart::Manager::checkProject(), KexiDB::SQLiteConnection::drv_getTablesList(), KexiDB::pqxxSqlConnection::drv_getTablesList(), KexiDB::MySqlConnection::drv_getTablesList(), KexiProject::items(), KexiCSVExport::exportData(), KexiDB::Connection::objectIds(), KexiDB::Connection::objectNames(), KexiDB::Connection::querySingleRecordInternal(), KexiDB::Connection::querySingleString(), KexiDB::Connection::queryStringList(), KexiDB::Connection::resultExists(), and KexiDB::Connection::setupTableSchema().

bool Cursor::moveLast  )  [virtual]
 

Moves current position to the last record and retrieves it.

Returns:
true if the last record was retrieved. False could mean that there was an error or there is no record available.

Definition at line 254 of file cursor.cpp.

References getNextRecord(), m_afterLast, m_atLast, m_opened, and m_validRecord.

bool Cursor::moveNext  )  [virtual]
 

Moves current position to the next record and retrieves it.

Definition at line 292 of file cursor.cpp.

References getNextRecord(), m_afterLast, and m_opened.

Referenced by KexiPart::Manager::checkProject(), KexiDB::SQLiteConnection::drv_getTablesList(), KexiDB::pqxxSqlConnection::drv_getTablesList(), KexiDB::MySqlConnection::drv_getTablesList(), KexiMainWindowImpl::initUserActions(), KexiMainWindowImpl::initUserMode(), KexiProject::items(), KexiCSVExport::exportData(), KexiDB::Connection::objectIds(), KexiDB::Connection::objectNames(), KexiDB::Connection::queryStringList(), and KexiDB::Connection::setupTableSchema().

bool Cursor::movePrev  )  [virtual]
 

Moves current position to the next record and retrieves it. Currently it's only supported for buffered cursors.

Definition at line 303 of file cursor.cpp.

References Buffered, drv_bufferMovePointerPrev(), drv_bufferMovePointerTo(), m_afterLast, m_at, m_opened, m_options, m_records_in_buf, and m_validRecord.

bool Cursor::open  ) 
 

Opens the cursor using data provided on creation. The data might be either QuerySchema or raw sql statement.

Definition at line 131 of file cursor.cpp.

References KexiDB::Connection::SelectStatementOptions::alsoRetrieveROWID, close(), drv_open(), ERR_SQL_EXECUTION_ERROR, KexiDB::Object::error(), getNextRecord(), KexiDBDbg, m_afterLast, m_at, m_conn, m_containsROWIDInfo, m_opened, m_query, m_queryParameters, m_rawStatement, KexiDB::Object::m_sql, m_validRecord, options(), and KexiDB::Object::setError().

Referenced by KexiDB::Connection::executeQuery(), reopen(), and KexiDataTableView::setData().

uint KexiDB::Cursor::options  )  const [inline]
 

Returns:
logically or'd cursor's options, selected from Cursor::Options enum.

Definition at line 117 of file cursor.h.

Referenced by open().

QueryColumnInfo::Vector Cursor::orderByColumnList  )  const
 

Returns:
a list of fields contained in ORDER BY section of the query.
See also:
setOrderBy(const QStringList&)

Definition at line 553 of file cursor.cpp.

References m_orderByColumnList.

QuerySchema* KexiDB::Cursor::query  )  const [inline]
 

Returns:
query schema used to define this cursor or NULL if the cursor is not defined by a query schema but by a raw statement.

Definition at line 103 of file cursor.h.

Referenced by KexiDataTableView::setData().

QValueList< QVariant > Cursor::queryParameters  )  const
 

Returns:
query parameters assigned to this cursor

Definition at line 558 of file cursor.cpp.

References m_queryParameters.

QString KexiDB::Cursor::rawStatement  )  const [inline]
 

Returns:
raw query statement used to define this cursor or null string if raw statement instead (but QuerySchema is defined instead).

Definition at line 113 of file cursor.h.

bool Cursor::reopen  ) 
 

Closes and then opens again the same cursor. If the cursor is not opened it is just opened and result of this open is returned. Otherwise, true is returned if cursor is successfully closed and then opened.

Definition at line 198 of file cursor.cpp.

References close(), m_opened, and open().

Referenced by moveFirst().

virtual const char** KexiDB::Cursor::rowData  )  const [pure virtual]
 

[PROTOTYPE]

Returns:
current record data or NULL if there is no current records.

Implemented in KexiDB::MySqlCursor, KexiDB::pqxxSqlCursor, and KexiDB::SQLiteCursor.

virtual QString KexiDB::Cursor::serverErrorMsg  )  [inline, virtual]
 

Returns:
(not i18n'd) description text (message) of last operation's error/result. In most cases engines do return such a messages, any user can then use this to refer a documentation. Note for driver developers: Leave the default implementation (null string is returned ) if your engine has no such capability.

Reimplemented from KexiDB::Object.

Reimplemented in KexiDB::MySqlCursor, and KexiDB::SQLiteCursor.

Definition at line 246 of file cursor.h.

Referenced by KexiDataTableView::setData().

virtual int KexiDB::Cursor::serverResult  )  [inline, virtual]
 

Returns:
a code of last executed operation's result at the server side. This code is engine dependent and may be even engine-version dependent. It can be visible in applications mainly after clicking a "Details>>" button or something like that -- this just can be useful for advanced users and for testing. Note for driver developers: Return here the value you usually store as result of most lower-level operations. By default this method returns 0.

Reimplemented from KexiDB::Object.

Reimplemented in KexiDB::MySqlCursor, and KexiDB::SQLiteCursor.

Definition at line 232 of file cursor.h.

virtual QString KexiDB::Cursor::serverResultName  )  [inline, virtual]
 

Returns:
(not i18n'd) name of last executed operation's result at the server side. Sometimes engines have predefined its result names that can be used e.g. to refer a documentation. SQLite is one of such engines. Note for driver developers: Leave the default implementation (null string is returned ) if your engine has no such capability.

Reimplemented from KexiDB::Object.

Reimplemented in KexiDB::MySqlCursor, and KexiDB::SQLiteCursor.

Definition at line 239 of file cursor.h.

void Cursor::setBuffered bool  buffered  ) 
 

Sets this cursor to buffered type or not. See description of buffered and nonbuffered cursors in class description. This method only works if cursor is not opened (isOpened()==false). You can close already opened cursor and then switch this option on/off.

Definition at line 361 of file cursor.cpp.

References Buffered, isBuffered(), m_opened, and m_options.

void Cursor::setOrderByColumnList const QString column1,
const QString column2 = QString::null,
const QString column3 = QString::null,
const QString column4 = QString::null,
const QString column5 = QString::null
 

Convenience method, similar to setOrderByColumnList(const QStringList&).

Definition at line 541 of file cursor.cpp.

void Cursor::setOrderByColumnList const QStringList &  columnNames  ) 
 

Sets a list of columns for ORDER BY section of the query. Only works when the cursor has been created using QuerySchema object (i.e. when query()!=0; does not work with raw statements). Each name on the list must be a field or alias present within the query and must not be covered by aliases. If one or more names cannot be found within the query, the method will have no effect. Any previous ORDER BY settings will be removed.

The order list provided here has priority over a list defined in the QuerySchema object itseld (using QuerySchema::setOrderByColumnList()). The QuerySchema object itself is not modifed by this method: only order of records retrieved by this cursor is affected.

Use this method before calling open(). You can also call reopen() after calling this method to see effects of applying records order.

Definition at line 529 of file cursor.cpp.

void Cursor::setQueryParameters const QValueList< QVariant > &  params  ) 
 

Sets query parameters params for this cursor.

Definition at line 563 of file cursor.cpp.

References m_queryParameters.

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

virtual void KexiDB::Cursor::storeCurrentRow RowData data  )  const [pure virtual]
 

Puts current record's data into data (makes a deep copy). This have unspecified behaviour if the cursor is not at valid record. Note: For reimplementation in driver's code. Shortly, this method translates a row data from internal representation (probably also used in buffer) to simple public RecordData representation.

Implemented in KexiDB::MySqlCursor, KexiDB::pqxxSqlCursor, and KexiDB::SQLiteCursor.

Referenced by KexiDB::Connection::querySingleRecordInternal(), and KexiDB::Connection::setupTableSchema().

bool Cursor::updateRow RowData data,
RowEditBuffer buf,
bool  useROWID = false
 

Todo:
doesn't update cursor's buffer YET!

Definition at line 461 of file cursor.cpp.

References KexiDB::Object::clearError(), m_conn, and m_query.

virtual QVariant KexiDB::Cursor::value uint  i  )  [pure virtual]
 

Returns:
a value stored in column number i (counting from 0). Is has unspecified behaviour if the cursor is not at valid record. Note for driver developers: If i is >= than m_fieldCount, null QVariant value should be returned. To return a value typically you can use a pointer to internal structure that contain current row data (buffered or unbuffered).

Implemented in KexiDB::MySqlCursor, KexiDB::pqxxSqlCursor, and KexiDB::SQLiteCursor.

Referenced by KexiPart::Manager::checkProject(), KexiDB::SQLiteConnection::drv_getTablesList(), KexiDB::pqxxSqlConnection::drv_getTablesList(), KexiDB::MySqlConnection::drv_getTablesList(), KexiUserAction::fromCurrentRecord(), KexiMainWindowImpl::initUserMode(), KexiProject::items(), KexiCSVExport::exportData(), KexiDB::Connection::objectIds(), KexiDB::Connection::objectNames(), KexiDB::Connection::querySingleString(), and KexiDB::Connection::queryStringList().


Member Data Documentation

bool KexiDB::Cursor::m_afterLast [protected]
 

Definition at line 328 of file cursor.h.

Referenced by close(), KexiDB::pqxxSqlCursor::drv_open(), KexiDB::MySqlCursor::drv_open(), eof(), getNextRecord(), init(), moveFirst(), moveLast(), moveNext(), movePrev(), and open().

Q_LLONG KexiDB::Cursor::m_at [protected]
 

Definition at line 332 of file cursor.h.

Referenced by at(), bof(), close(), KexiDB::MySqlCursor::drv_bufferMovePointerPrev(), KexiDB::MySqlCursor::drv_open(), getNextRecord(), init(), moveFirst(), movePrev(), and open().

bool KexiDB::Cursor::m_atLast [protected]
 

Definition at line 327 of file cursor.h.

Referenced by init(), and moveLast().

bool KexiDB::Cursor::m_buffering_completed [protected]
 

true if we already have all records stored in the buffer

Definition at line 340 of file cursor.h.

Referenced by KexiDB::pqxxSqlCursor::drv_open(), KexiDB::MySqlCursor::drv_open(), getNextRecord(), init(), and moveFirst().

QGuardedPtr<Connection> KexiDB::Cursor::m_conn [protected]
 

Definition at line 321 of file cursor.h.

Referenced by debugString(), deleteAllRows(), deleteRow(), init(), insertRow(), open(), updateRow(), and ~Cursor().

bool KexiDB::Cursor::m_containsROWIDInfo [protected]
 

Definition at line 331 of file cursor.h.

Referenced by KexiDB::pqxxSqlCursor::drv_open(), init(), open(), and KexiDB::pqxxSqlCursor::storeCurrentRow().

uint KexiDB::Cursor::m_fieldCount [protected]
 

cached field count information

Definition at line 333 of file cursor.h.

Referenced by clearBuffer(), close(), KexiDB::SQLiteCursor::drv_appendCurrentRecordToBuffer(), KexiDB::SQLiteCursor::drv_clearBuffer(), KexiDB::SQLiteCursor::drv_getNextRecord(), KexiDB::pqxxSqlCursor::drv_open(), KexiDB::MySqlCursor::drv_open(), init(), KexiDB::SQLiteCursor::storeCurrentRow(), KexiDB::pqxxSqlCursor::storeCurrentRow(), KexiDB::MySqlCursor::storeCurrentRow(), KexiDB::SQLiteCursor::value(), KexiDB::pqxxSqlCursor::value(), and KexiDB::MySqlCursor::value().

QueryColumnInfo::Vector* KexiDB::Cursor::m_fieldsExpanded [protected]
 

Useful e.g. for value(int) method when we need access to schema def.

Definition at line 344 of file cursor.h.

Referenced by init(), KexiDB::SQLiteCursor::storeCurrentRow(), KexiDB::MySqlCursor::storeCurrentRow(), KexiDB::SQLiteCursor::value(), KexiDB::MySqlCursor::value(), and ~Cursor().

uint KexiDB::Cursor::m_logicalFieldCount [protected]
 

logical field count, i.e. without intrernal values like ROWID or lookup

Definition at line 334 of file cursor.h.

Referenced by close(), and init().

bool KexiDB::Cursor::m_opened [protected]
 

Definition at line 325 of file cursor.h.

Referenced by close(), KexiDB::MySqlCursor::drv_close(), KexiDB::MySqlCursor::drv_open(), init(), moveFirst(), moveLast(), moveNext(), movePrev(), open(), reopen(), and setBuffered().

uint KexiDB::Cursor::m_options [protected]
 

cursor options that describes its behaviour

Definition at line 335 of file cursor.h.

Referenced by getNextRecord(), isBuffered(), moveFirst(), movePrev(), KexiDB::MySqlCursor::MySqlCursor(), KexiDB::pqxxSqlCursor::pqxxSqlCursor(), and setBuffered().

QueryColumnInfo::Vector* KexiDB::Cursor::m_orderByColumnList [protected]
 

Used by setOrderByColumnList().

Definition at line 347 of file cursor.h.

Referenced by init(), and orderByColumnList().

QuerySchema* KexiDB::Cursor::m_query [protected]
 

Definition at line 322 of file cursor.h.

Referenced by deleteAllRows(), deleteRow(), init(), insertRow(), open(), updateRow(), and ~Cursor().

QValueList<QVariant>* KexiDB::Cursor::m_queryParameters [protected]
 

Definition at line 349 of file cursor.h.

Referenced by init(), open(), queryParameters(), setQueryParameters(), and ~Cursor().

QString KexiDB::Cursor::m_rawStatement [protected]
 

Definition at line 324 of file cursor.h.

Referenced by