PDA

View Full Version : QDatabaseConverter



zweieck
17th August 2008, 19:39
Hi,

i need to convert data of databases around (mysql, sqlite, oracle, Access, .. in all directions).
After searching i found some interesting things (like e.g. dbconvert.com).
In order to not reinvent the wheel i got the first important question:

Does anybody know of such a (free) tool?
Does anybody know of such a tool written in Qt?


But however i plan to develop something myself:

a library to do the conversion job (in a Qt-ish style)
a command line tool (obviously using the library)
a GUI application allowing to Drag&Drop tables structure, data (or even only for example selected rows of source table) from source to target (think of it as 2 treeviews having an explorer like structure where you can copy data from different databases just like copying/moving files)


Do you think there might be a need for such tools?

Any hints for features appreciated.

Thanks,

RZ

const
19th September 2008, 07:17
But however i plan to develop something myself:

a library to do the conversion job (in a Qt-ish style)
a command line tool (obviously using the library)
a GUI application allowing to Drag&Drop tables structure, data (or even only for example selected rows of source table) from source to target (think of it as 2 treeviews having an explorer like structure where you can copy data from different databases just like copying/moving files)

RZ

Hello, Zweieck! What about your plans? I think that such tools will be very useful for all database/qt developers.

patrik08
19th September 2008, 08:43
Hello, Zweieck! What about your plans? I think that such tools will be very useful for all database/qt developers.

I write one to extract from mysql + edit
to get on http://ppk.ciz.ch/qt_c++/mysql_model_browser/ 24 kb

http://ppk.ciz.ch/qt_c++/mysql_model_browser/mysql_browser_model.png

if you write a url connection to db you can swap to other driver ...
and rewrite all global query




QString Scheme = QString( "mysql://username:pass@host:port/database" )
QUrl dns(Scheme,QUrl::TolerantMode);
const QString dbase = dns.path().replace("/","");
QStringList drivers = QSqlDatabase::drivers();
QString const type = "Q"+dns.scheme().toUpper();
if (!drivers.contains(type)) {
std::cout << "######### " << qPrintable(tr("Unable to Load Driver %1").arg(type)) << "\n" << std::endl;
return false;
}