1
/* This file is part of the KDE project
2
Copyright (C) 2004 Martin Ellis <m.a.ellis@ncl.ac.uk>
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.
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.
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., 59 Temple Place - Suite 330,
17
Boston, MA 02111-1307, USA.
20
#ifndef KEXIDB_MYSQLCLIENT_P_H
21
#define KEXIDB_MYSQLCLIENT_P_H
24
#include <mysql/config-win.h>
28
typedef struct st_mysql MYSQL;
34
#define NAMESPACE KexiMigration
36
#define NAMESPACE KexiDB
43
//! Internal MySQL connection data.
44
/*! Provides a low-level API for accessing MySQL databases, that can
45
be shared by any module that needs direct access to the underlying
46
database. Used by the KexiDB and KexiMigration drivers.
48
class MySqlConnectionInternal
51
MySqlConnectionInternal();
52
~MySqlConnectionInternal();
53
//! Connect to a MySQL database
54
bool db_connect(const KexiDB::ConnectionData& data);
55
//! Disconnect from the database
58
//! Select a database that is about to be used
59
bool useDatabase(const QString &dbName = QString::null);
61
//! Execute SQL statement on the database
62
bool executeSQL( const QString& statement );
64
//! Stores last result's error status
67
//! Escape a table, database or column name
68
QString escapeIdentifier(const QString& str) const;
71
QString errmsg; //<! server-specific message of last operation
72
int res; //<! result code of last operation on server
76
//! Internal MySQL cursor data.
77
/*! Provides a low-level abstraction for iterating over MySql result sets.
80
class MySqlCursorData : public MySqlConnectionInternal
84
: MySqlConnectionInternal()
97
unsigned long *lengths;
98
unsigned long numRows;