26#include "kexidb/tableschema.h"
27#include "kexidb/connection.h"
28#include "keximigratedata.h"
30#include <kgenericfactory.h>
31#include <tqstringlist.h>
32#include <tqguardedptr.h>
47#define KEXI_MIGRATION_VERSION_MAJOR 1
48#define KEXI_MIGRATION_VERSION_MINOR 1
87 KexiMigration::Data*
data()
const {
return m_migrateData; }
91 void setData(KexiMigration::Data* migrateData);
103 bool& acceptingNeeded);
107 bool isSourceAndDestinationDataSourceTheSame()
const;
118 virtual int versionMajor()
const = 0;
119 virtual int versionMinor()
const = 0;
124 virtual TQVariant propertyValue(
const TQCString& propName );
127 void setPropertyValue(
const TQCString& propName,
const TQVariant& value );
132 TQString propertyCaption(
const TQCString& propName )
const;
136 TQValueList<TQCString> propertyNames()
const;
141 virtual bool isValid();
144 void progressPercent(
int percent);
148 KexiMigrate(TQObject *parent,
const char *name,
const TQStringList &args = TQStringList());
171 virtual bool drv_queryMaxNumber(
const TQString& tableName,
172 const TQString& columnName,
int& result);
183 const TQString& sqlStatement, uint columnNumber, TQStringList& stringList,
185 { Q_UNUSED(sqlStatement); Q_UNUSED(columnNumber); Q_UNUSED(stringList);
186 Q_UNUSED(numRecords);
195 virtual tristate drv_querySingleStringFromSQL(
const TQString& sqlStatement,
196 uint columnNumber, TQString&
string);
208 { Q_UNUSED(sqlStatement); Q_UNUSED(data); Q_UNUSED(firstRecord);
217 virtual bool drv_progressSupported() {
return false; }
239 void updateProgress(TQ_ULLONG step = 1ULL);
245 virtual TQString drv_escapeIdentifier(
const TQString& str )
const {
246 return m_kexiDBDriver ? m_kexiDBDriver->escapeIdentifier(str) : str; }
270 bool tableNames(TQStringList& tablenames);
273 TQPtrList<KexiDB::TableSchema> m_tableSchemas;
275 TQPtrList<KexiDB::TableSchema> m_kexiDBCompatibleTableSchemasToRemoveFromMemoryAfterImport;
281 bool progressInitialise();
286 TQ_ULLONG m_progressTotal;
289 TQ_ULLONG m_progressDone;
292 TQ_ULLONG m_progressNextReport;
301#define KEXIMIGRATE_DRIVER_INFO( class_name, internal_name ) \
302 int class_name::versionMajor() const { return KEXI_MIGRATION_VERSION_MAJOR; } \
303 int class_name::versionMinor() const { return KEXI_MIGRATION_VERSION_MINOR; } \
304 K_EXPORT_COMPONENT_FACTORY(keximigrate_ ## internal_name, \
305 KGenericFactory<KexiMigration::class_name>( "keximigrate_" #internal_name ))
309#define KEXIMIGRATION_DRIVER \
311 virtual int versionMajor() const; \
312 virtual int versionMinor() const;
Provides database connection, allowing queries and data modification.
Imports non-native databases into Kexi projects.
TQGuardedPtr< KexiDB::Driver > m_kexiDBDriver
KexiDB driver. For instance, it is used for escaping identifiers.
virtual tristate drv_fetchRecordFromSQL(const TQString &sqlStatement, KexiDB::RowData &data, bool &firstRecord)
virtual bool drv_tableNames(TQStringList &tablenames)=0
Get table names in source database (driver specific)
virtual bool drv_readTableSchema(const TQString &originalName, KexiDB::TableSchema &tableSchema)=0
Read schema for a given table (driver specific)
bool progressSupported()
Returns true if the migration driver supports progress updates.
virtual bool drv_connect()=0
Connect to source database (driver specific)
virtual tristate drv_queryStringListFromSQL(const TQString &sqlStatement, uint columnNumber, TQStringList &stringList, int numRecords=-1)
virtual bool drv_getTableSize(const TQString &, TQ_ULLONG &)
KexiMigration::Data * data() const
TQMap< TQCString, TQString > m_propertyCaptions
virtual bool drv_copyTable(const TQString &srcTable, KexiDB::Connection *destConn, KexiDB::TableSchema *dstTable)=0
Copy a table from source DB to target DB (driver specific)
TQMap< TQCString, TQVariant > m_properties
virtual bool drv_disconnect()=0
Disconnect from source database (driver specific)
KexiMigration::Data * m_migrateData
Migrate Options.
Migration library management, for finding and loading mogration drivers.
A project's main controller.
3-state logical type with three values: true, false and cancelled and convenient operators.
TQValueVector< TQVariant > RowData
structure for storing single record with type information
Framework for importing databases into native KexiDB databases.
KEXIMIGR_EXPORT int versionMajor()
KEXIMIGR_EXPORT int versionMinor()
Namespace for general Kexi functions.