1
/* This file is part of the KDE project
2
Copyright (C) 2005,2006 Martin Ellis <martin.ellis@kdemail.net>
3
Copyright (C) 2005 Jarosław Staniek <staniek@kde.org>
5
This program is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this program; see the file COPYING. If not, write to
17
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
Boston, MA 02110-1301, USA.
26
#include <migration/keximigrate.h>
27
#include <migration/keximigrate_p.h>
28
#include <kexidb/field.h>
29
#include <kexidb/connection.h>
32
namespace KexiMigration
35
class MDBMigrate : public KexiMigrate
41
MDBMigrate(QObject *parent, const QVariantList& args = QVariantList());
42
virtual ~MDBMigrate();
44
//! Convert an MDB type to a KexiDB type, prompting user if necessary.
45
KexiDB::Field::Type type(int type);
47
//! Get the table definition for a given table name
48
/*! Look up the table definition for the given table. This only returns a ptr
49
to the MdbTableDef - it doesn't load e.g. the column data.
50
Remember to mdb_free_tabledef the table definition when it's finished
52
\return the table definition, or null if no matching table was found
54
MdbTableDef* getTableDef(const QString& tableName);
56
QVariant toQVariant(const char* data, unsigned int len, int type);
58
bool getPrimaryKey(KexiDB::TableSchema* table, MdbTableDef* tableDef);
60
//! Reimplemented to add support for "sourceDatabaseHasNonUnicodeEncoding" property
61
//! @todo this should be in Connection class but Migration framework has no such yet!
62
virtual QVariant propertyValue(const QByteArray& propName);
65
//! Driver specific function to return table names
66
virtual bool drv_tableNames(QStringList& tablenames);
68
//! Driver specific implementation to read a table schema
69
virtual bool drv_readTableSchema(
70
const QString& originalName, KexiDB::TableSchema& tableSchema);
72
//! Driver specific connection implementation
73
virtual bool drv_connect();
75
//! Disconnect from the db backend
76
virtual bool drv_disconnect();
78
/*! Copy MDB table to KexiDB database */
79
virtual bool drv_copyTable(const QString& srcTable,
80
KexiDB::Connection *destConn, KexiDB::TableSchema* dstTable);
82
virtual bool drv_progressSupported() {
85
virtual bool drv_getTableSize(const QString& table, qulonglong& size);
89
void releaseBackend();