KDb

XbaseConnection.h
1/* This file is part of the KDE project
2 Copyright (C) 2008 Sharan Rao <sharanrao@gmail.com>
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
28class xBaseConnectionInternal;
29
30/*! @short Provides database connection, allowing queries and data modification.
31*/
33{
34public:
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
45protected:
46
47 /*! Used by driver */
48 xBaseConnection(KDbDriver *driver, KDbDriver* internalDriver, const KDbConnectionData& connData);
49
50 virtual bool drv_connect(KDbServerVersionInfo* version);
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
Database specific connection data, e.g. host, port.
Provides database connection, allowing queries and data modification.
KDbDriver * driver() const
virtual bool drv_connect()=0
Provides database cursor functionality.
Definition KDbCursor.h:69
Database driver's abstraction.
Definition KDbDriver.h:50
Specialized string for escaping.
Prepared statement interface for backend-dependent implementations.
KDbQuerySchema provides information about database query.
Provides database connection, allowing queries and data modification.
virtual quint64 drv_lastInsertRecordId()
virtual bool drv_closeDatabase()
virtual bool drv_executeSql(const KDbEscapedString &sql)
Executes query for a raw SQL statement sql without returning resulting records.
virtual bool drv_getTablesList(QStringList *list)
virtual bool drv_useDatabase(const QString &dbName=QString(), bool *cancelled=0, KDbMessageHandler *msgHandler=0)
virtual bool drv_createDatabase(const QString &dbName=QString())
virtual QString serverResultName() const
Implemented for KDbResultable.
virtual bool drv_getDatabasesList(QStringList *list)
virtual bool drv_dropDatabase(const QString &dbName=QString())
xBaseConnection(KDbDriver *driver, KDbDriver *internalDriver, const KDbConnectionData &connData)
virtual bool drv_disconnect()
virtual bool drv_containsTable(const QString &tableName)
KDbPreparedStatementInterface * prepareStatementInternal() override
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:11:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.