KDb

XbaseConnection.h
1 /* This file is part of the KDE project
2  Copyright (C) 2008 Sharan Rao <[email protected]>
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this program; see the file COPYING. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef XBASECONNECTION_H
21 #define XBASECONNECTION_H
22 
23 #include <QStringList>
24 
25 #include "KDbConnection.h"
26 #include "XbaseCursor.h"
27 
28 class xBaseConnectionInternal;
29 
30 /*! @short Provides database connection, allowing queries and data modification.
31 */
33 {
34 public:
35  virtual ~xBaseConnection();
36 
37  Q_REQUIRED_RESULT KDbCursor *prepareQuery(const KDbEscapedString &sql,
38  int cursor_options = 0) override;
39  Q_REQUIRED_RESULT KDbCursor *prepareQuery(KDbQuerySchema *query,
40  int cursor_options = 0) override;
41 
42  //! @todo returns @c nullptr for now
43  Q_REQUIRED_RESULT KDbPreparedStatementInterface *prepareStatementInternal() override;
44 
45 protected:
46 
47  /*! Used by driver */
48  xBaseConnection(KDbDriver *driver, KDbDriver* internalDriver, const KDbConnectionData& connData);
49 
51  virtual bool drv_disconnect();
52  virtual bool drv_getDatabasesList(QStringList* list);
53  virtual bool drv_createDatabase( const QString &dbName = QString() );
54  virtual bool drv_useDatabase( const QString &dbName = QString(), bool *cancelled = 0,
55  KDbMessageHandler* msgHandler = 0 );
56  virtual bool drv_closeDatabase();
57  virtual bool drv_dropDatabase(const QString &dbName = QString());
58  virtual bool drv_executeSql(const KDbEscapedString& sql);
59  virtual quint64 drv_lastInsertRecordId();
60 
61  //! Implemented for KDbResultable
62  virtual QString serverResultName() const;
63 // virtual void drv_clearServerResult();
64 
65  //! @todo move this somewhere to low level class (MIGRATION?)
66  virtual bool drv_getTablesList(QStringList* list);
67  //! @todo move this somewhere to low level class (MIGRATION?)
68  virtual bool drv_containsTable(const QString &tableName);
69 
70  xBaseConnectionInternal* d;
71 
72  friend class xBaseDriver;
73  friend class xBaseCursor;
74 };
75 
76 #endif
virtual bool drv_useDatabase(const QString &dbName=QString(), bool *cancelled=0, KDbMessageHandler *msgHandler=0)
Provides database cursor functionality.
Definition: KDbCursor.h:68
virtual bool drv_getDatabasesList(QStringList *list)
virtual bool drv_createDatabase(const QString &dbName=QString())
virtual bool drv_getTablesList(QStringList *list)
xBaseConnection(KDbDriver *driver, KDbDriver *internalDriver, const KDbConnectionData &connData)
Specialized string for escaping.
Database driver's abstraction.
Definition: KDbDriver.h:49
virtual bool drv_executeSql(const KDbEscapedString &sql)
Executes query for a raw SQL statement sql without returning resulting records.
virtual bool drv_dropDatabase(const QString &dbName=QString())
virtual quint64 drv_lastInsertRecordId()
virtual QString serverResultName() const
Implemented for KDbResultable.
Provides database connection, allowing queries and data modification.
virtual bool drv_connect()=0
KDbPreparedStatementInterface * prepareStatementInternal() override
Prepared statement interface for backend-dependent implementations.
virtual bool drv_disconnect()
KDbQuerySchema provides information about database query.
unsigned int version()
Definition: KDb.cpp:336
Database specific connection data, e.g. host, port.
virtual bool drv_closeDatabase()
Provides database connection, allowing queries and data modification.
Definition: KDbConnection.h:51
KDbDriver * driver() const
virtual bool drv_containsTable(const QString &tableName)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jun 25 2022 06:21:40 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.