Kexi API Documentation (2.0 alpha)

KexiDB::pqxxSqlCursor Class Reference

#include <pqxxcursor.h>

Inheritance diagram for KexiDB::pqxxSqlCursor:

KexiDB::Cursor KexiDB::Object List of all members.

Public Member Functions

virtual ~pqxxSqlCursor ()
virtual QVariant value (uint i)
virtual const char ** rowData () const
virtual void storeCurrentRow (RowData &data) const

Protected Member Functions

 pqxxSqlCursor (Connection *conn, const QString &statement=QString::null, uint options=NoOptions)
 pqxxSqlCursor (Connection *conn, QuerySchema &query, uint options=NoOptions)
virtual void drv_clearServerResult ()
virtual void drv_appendCurrentRecordToBuffer ()
virtual void drv_bufferMovePointerNext ()
virtual void drv_bufferMovePointerPrev ()
virtual void drv_bufferMovePointerTo (Q_LLONG to)
virtual bool drv_open ()
virtual bool drv_close ()
virtual void drv_getNextRecord ()
virtual void drv_getPrevRecord ()

Friends

class pqxxSqlConnection

Constructor & Destructor Documentation

pqxxSqlCursor::~pqxxSqlCursor  )  [virtual]
 

Definition at line 68 of file pqxxcursor.cpp.

References KexiDB::Cursor::close().

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

Definition at line 42 of file pqxxcursor.cpp.

References KexiDB::Cursor::Buffered, and KexiDB::Cursor::m_options.

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

Definition at line 55 of file pqxxcursor.cpp.

References KexiDB::Cursor::Buffered, and KexiDB::Cursor::m_options.


Member Function Documentation

void pqxxSqlCursor::drv_appendCurrentRecordToBuffer  )  [protected, 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.

Implements KexiDB::Cursor.

Definition at line 309 of file pqxxcursor.cpp.

void pqxxSqlCursor::drv_bufferMovePointerNext  )  [protected, 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.

Implements KexiDB::Cursor.

Definition at line 317 of file pqxxcursor.cpp.

void pqxxSqlCursor::drv_bufferMovePointerPrev  )  [protected, virtual]
 

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

Implements KexiDB::Cursor.

Definition at line 325 of file pqxxcursor.cpp.

void pqxxSqlCursor::drv_bufferMovePointerTo Q_LLONG  to  )  [protected, virtual]
 

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

Implements KexiDB::Cursor.

Definition at line 333 of file pqxxcursor.cpp.

void pqxxSqlCursor::drv_clearServerResult  )  [protected, virtual]
 

Todo:
pqxxSqlCursor: stuff with server results

Implements KexiDB::Cursor.

Definition at line 300 of file pqxxcursor.cpp.

bool pqxxSqlCursor::drv_close  )  [protected, virtual]
 

Implements KexiDB::Cursor.

Definition at line 137 of file pqxxcursor.cpp.

void pqxxSqlCursor::drv_getNextRecord  )  [protected, virtual]
 

Implements KexiDB::Cursor.

Definition at line 155 of file pqxxcursor.cpp.

References KexiDB::Cursor::at(), KexiDB::Cursor::FetchEnd, KexiDB::Cursor::FetchError, KexiDB::Cursor::FetchOK, and KexiDB::Cursor::m_result.

void pqxxSqlCursor::drv_getPrevRecord  )  [protected, virtual]
 

Definition at line 174 of file pqxxcursor.cpp.

References KexiDB::Cursor::at(), KexiDB::Cursor::FetchEnd, KexiDB::Cursor::FetchError, KexiDB::Cursor::FetchOK, and KexiDB::Cursor::m_result.

bool pqxxSqlCursor::drv_open  )  [protected, virtual]
 

Todo:
this check should be moved to Connection! when drv_prepareQuery() arrive

Implements KexiDB::Cursor.

Definition at line 75 of file pqxxcursor.cpp.

References KexiDB::Cursor::connection(), ERR_DB_SPECIFIC, ERR_NO_CONNECTION, KexiDBDrvWarn, KexiDB::Cursor::m_afterLast, KexiDB::Cursor::m_buffering_completed, KexiDB::Cursor::m_containsROWIDInfo, KexiDB::Cursor::m_fieldCount, KexiDB::Cursor::m_records_in_buf, KexiDB::Object::m_sql, pqxxSqlCursor_trans_num, and KexiDB::Object::setError().

const char ** pqxxSqlCursor::rowData  )  const [virtual]
 

[PROTOTYPE]

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

Implements KexiDB::Cursor.

Definition at line 256 of file pqxxcursor.cpp.

References KexiDB::Cursor::at(), and KexiDBDrvWarn.

void pqxxSqlCursor::storeCurrentRow RowData data  )  const [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.

Implements KexiDB::Cursor.

Definition at line 282 of file pqxxcursor.cpp.

References KexiDB::Cursor::m_containsROWIDInfo, and KexiDB::Cursor::m_fieldCount.

QVariant pqxxSqlCursor::value uint  i  )  [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).

Implements KexiDB::Cursor.

Definition at line 194 of file pqxxcursor.cpp.

References KexiDB::Cursor::m_fieldCount.


Friends And Related Function Documentation

friend class pqxxSqlConnection [friend]
 

Definition at line 74 of file pqxxcursor.h.


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:42 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003