kexi

sqlite/sqliteconnection.h
1/* This file is part of the KDE project
2 Copyright (C) 2003-2006 Jaroslaw Staniek <js@iidea.pl>
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 KEXIDB_CONN_SQLITE_H
21#define KEXIDB_CONN_SQLITE_H
22
23#include <tqstringlist.h>
24
25#include <kexidb/connection.h>
26
29
30namespace KexiDB
31{
32
33class SQLiteConnectionInternal;
34class Driver;
35
38{
39 TQ_OBJECT
40
41
42 public:
43 virtual ~SQLiteConnection();
44
45 virtual Cursor* prepareQuery( const TQString& statement, uint cursor_options = 0 );
46 virtual Cursor* prepareQuery( QuerySchema& query, uint cursor_options = 0 );
47
48//#ifndef SQLITE2 //TEMP IFDEF!
49 virtual PreparedStatement::Ptr prepareStatement(PreparedStatement::StatementType type,
50 FieldList& fields);
51//#endif
53 virtual bool isReadOnly() const;
54
55 protected:
57 SQLiteConnection( Driver *driver, ConnectionData &conn_data );
58
60 virtual bool drv_disconnect();
61 virtual bool drv_getDatabasesList( TQStringList &list );
62
63//TODO: move this somewhere to low level class (MIGRATION?)
64 virtual bool drv_getTablesList( TQStringList &list );
65
66//TODO: move this somewhere to low level class (MIGRATION?)
67 virtual bool drv_containsTable( const TQString &tableName );
68
72 virtual bool drv_createDatabase( const TQString &dbName = TQString() );
73
78 virtual bool drv_useDatabase( const TQString &dbName = TQString(), bool *cancelled = 0,
79 MessageHandler* msgHandler = 0 );
80
81 virtual bool drv_closeDatabase();
82
86 virtual bool drv_dropDatabase( const TQString &dbName = TQString() );
87
88 //virtual bool drv_createTable( const KexiDB::Table& table );
89
90 virtual bool drv_executeSQL( const TQString& statement );
91// virtual bool drv_executeQuery( const TQString& statement );
92
93 virtual TQ_ULLONG drv_lastInsertRowID();
94
95 virtual int serverResult();
96 virtual TQString serverResultName();
97 virtual TQString serverErrorMsg();
98 virtual void drv_clearServerResult();
99 virtual tristate drv_changeFieldProperty(TableSchema &table, Field& field,
100 const TQString& propertyName, const TQVariant& value);
101
102#ifdef SQLITE2
112 virtual bool drv_alterTableName(TableSchema& tableSchema, const TQString& newName, bool replace = false);
113#endif
114
117
118 SQLiteConnectionInternal* d;
119
120 friend class SQLiteDriver;
121 friend class SQLiteCursor;
122};
123
124}
125
126#endif
Database specific connection data, e.g. host, port.
TableSchema * tableSchema(int tableId)
Driver * driver() const
Definition connection.h:78
virtual bool drv_alterTableName(TableSchema &tableSchema, const TQString &newName)
friend class KexiDB::TableSchema
for removeMe()
Connection(Driver *driver, ConnectionData &conn_data)
Generic database abstraction.
Definition driver.h:67
Meta-data for a field.
Definition field.h:73
StatementType
Defines type of the prepared statement.
KexiDB::QuerySchema provides information about database query.
virtual bool drv_executeSQL(const TQString &statement)
virtual tristate drv_changeFieldProperty(TableSchema &table, Field &field, const TQString &propertyName, const TQVariant &value)
virtual bool drv_connect(KexiDB::ServerVersionInfo &version)
virtual bool drv_getTablesList(TQStringList &list)
tristate changeFieldType(TableSchema &table, Field &field, Field::Type type)
for drv_changeFieldProperty()
virtual bool drv_createDatabase(const TQString &dbName=TQString())
virtual bool drv_getDatabasesList(TQStringList &list)
virtual bool drv_dropDatabase(const TQString &dbName=TQString())
virtual bool drv_containsTable(const TQString &tableName)
virtual PreparedStatement::Ptr prepareStatement(PreparedStatement::StatementType type, FieldList &fields)
virtual Cursor * prepareQuery(const TQString &statement, uint cursor_options=0)
SQLiteConnection(Driver *driver, ConnectionData &conn_data)
virtual bool drv_useDatabase(const TQString &dbName=TQString(), bool *cancelled=0, MessageHandler *msgHandler=0)
Contains version information about a database backend.
Definition global.h:126
3-state logical type with three values: true, false and cancelled and convenient operators.
Definition tristate.h:100
High-level database connectivity library with database backend drivers.
KEXI_DB_EXPORT DatabaseVersionInfo version()
Definition global.cpp:55