kexi
pqxxcursor.h
00001 /* This file is part of the KDE project 00002 Copyright (C) 2003 Adam Pigg <adam@piggz.co.uk> 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this program; see the file COPYING. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef KEXIDB_CURSOR_PQXX_H 00021 #define KEXIDB_CURSOR_PQXX_H 00022 00023 #include <kexidb/cursor.h> 00024 #include <kexidb/connection.h> 00025 00026 #if 0 00027 #include <pqxx/all.h> 00028 #else 00029 #include <pqxx/pqxx> 00030 #endif 00031 00032 #include <pqxx/binarystring> 00033 00034 namespace KexiDB { 00035 00036 class pqxxSqlCursor: public Cursor { 00037 public: 00038 virtual ~pqxxSqlCursor(); 00039 00040 virtual QVariant value(uint i); 00041 virtual const char** rowData() const; 00042 virtual void storeCurrentRow(RowData &data) const; 00043 00044 //TODO virtual const char *** bufferData() 00045 00046 //TODO virtual int serverResult() const; 00047 00048 //TODO virtual QString serverResultName() const; 00049 00050 //TODO virtual QString serverErrorMsg() const; 00051 00052 protected: 00053 pqxxSqlCursor(Connection* conn, const QString& statement = QString::null, uint options = NoOptions ); 00054 pqxxSqlCursor(Connection* conn, QuerySchema& query, uint options = NoOptions ); 00055 virtual void drv_clearServerResult(); 00056 virtual void drv_appendCurrentRecordToBuffer(); 00057 virtual void drv_bufferMovePointerNext(); 00058 virtual void drv_bufferMovePointerPrev(); 00059 virtual void drv_bufferMovePointerTo(Q_LLONG to); 00060 virtual bool drv_open(); 00061 virtual bool drv_close(); 00062 virtual void drv_getNextRecord(); 00063 virtual void drv_getPrevRecord(); 00064 00065 private: 00066 pqxx::result* m_res; 00067 // pqxx::nontransaction* m_tran; 00068 pqxx::connection* my_conn; 00069 QVariant pValue(uint pos)const; 00070 bool m_implicityStarted : 1; 00071 //QByteArray processBinaryData(pqxx::binarystring*) const; 00072 friend class pqxxSqlConnection; 00073 }; 00074 00075 } 00076 00077 #endif