kexi
mysqlmigrate.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef MYSQLMIGRATE_H
00022 #define MYSQLMIGRATE_H
00023
00024 #include "migration/keximigrate.h"
00025 #include "kexidb/drivers/mySQL/mysqlconnection_p.h"
00026
00027 namespace KexiMigration
00028 {
00029
00030 class MySQLMigrate : public KexiMigrate
00031 {
00032 Q_OBJECT
00033 KEXIMIGRATION_DRIVER
00034
00035 private:
00036 MySqlConnectionInternal *d;
00037 MYSQL_RES *m_mysqlres;
00038
00039 protected:
00040
00041 virtual bool drv_tableNames(QStringList& tablenames);
00042
00043
00044 virtual bool drv_readTableSchema(
00045 const QString& originalName, KexiDB::TableSchema& tableSchema);
00046
00047 virtual bool drv_connect();
00048 virtual bool drv_disconnect();
00049
00050 virtual tristate drv_queryStringListFromSQL(
00051 const QString& sqlStatement, uint columnNumber,
00052 QStringList& stringList, int numRecords = -1);
00053
00054 virtual tristate drv_fetchRecordFromSQL(const QString& sqlStatement,
00055 KexiDB::RowData& data, bool &firstRecord);
00056
00057 virtual bool drv_copyTable(const QString& srcTable,
00058 KexiDB::Connection *destConn, KexiDB::TableSchema* dstTable);
00059
00060 virtual bool drv_progressSupported() { return true; }
00061 virtual bool drv_getTableSize(const QString& table, Q_ULLONG& size);
00062
00063
00064
00065
00066
00067
00068 public:
00069
00070 MySQLMigrate(QObject *parent, const char *name, const QStringList& args = QStringList());
00071 ~MySQLMigrate();
00072
00073 KexiDB::Field::Type type(const QString& table, const MYSQL_FIELD* t);
00074
00075 KexiDB::Field::Type examineBlobField(const QString& table,
00076 const MYSQL_FIELD* fld);
00077
00078 QStringList examineEnumField(const QString& table,
00079 const MYSQL_FIELD* fld);
00080 void getConstraints(int mysqlConstraints, KexiDB::Field* fld);
00081 void getOptions(int flags, KexiDB::Field* fld);
00082 };
00083 }
00084
00085 #endif
|