1
/* This file is part of the KDE project
2
Copyright (C) 2003 Jaroslaw Staniek <js@iidea.pl>
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_CONN_SQLITE_H
21
#define KEXIDB_CONN_SQLITE_H
23
#include <qstringlist.h>
25
#include <kexidb/connection.h>
33
class SQLiteConnectionInternal;
36
//! sqlite-specific connection
37
class SQLiteConnection : public Connection
42
virtual ~SQLiteConnection();
44
virtual Cursor* prepareQuery( const QString& statement, uint cursor_options = 0 );
45
virtual Cursor* prepareQuery( QuerySchema& query, uint cursor_options = 0 );
49
SQLiteConnection( Driver *driver, ConnectionData &conn_data );
51
virtual bool drv_connect();
52
virtual bool drv_disconnect();
53
virtual bool drv_getDatabasesList( QStringList &list );
54
//TODO: move this somewhere to low level class (MIGRATION?)
55
virtual bool drv_getTablesList( QStringList &list );
56
//TODO: move this somewhere to low level class (MIGRATION?)
57
virtual bool drv_containsTable( const QString &tableName );
58
/*! Creates new database using connection. Note: Do not pass \a dbName
59
arg because for file-based engine (that has one database per connection)
60
it is defined during connection. */
61
virtual bool drv_createDatabase( const QString &dbName = QString::null );
62
/*! Opens existing database using connection. Do not pass \a dbName
63
arg because for file-based engine (that has one database per connection)
64
it is defined during connection. If you pass it,
65
database file name will be changed. */
66
virtual bool drv_useDatabase( const QString &dbName = QString::null );
67
virtual bool drv_closeDatabase();
68
/*! Drops database from the server using connection.
69
After drop, database shouldn't be accessible
70
anymore, so database file is just removed. See note from drv_useDatabase(). */
71
virtual bool drv_dropDatabase( const QString &dbName = QString::null );
73
//virtual bool drv_createTable( const KexiDB::Table& table );
75
virtual bool drv_executeSQL( const QString& statement );
76
// virtual bool drv_executeQuery( const QString& statement );
78
virtual Q_ULLONG drv_lastInsertRowID();
80
virtual int serverResult();
81
virtual QString serverResultName();
82
virtual QString serverErrorMsg();
83
virtual void drv_clearServerResult();
85
SQLiteConnectionInternal* d;
87
friend class SQLiteDriver;
88
friend class SQLiteCursor;