ceumicrodata / mETL

mito ETL tool
161 stars 41 forks source link

fix mysql varchar limit #11

Closed PiTiLeZarD closed 11 years ago

PiTiLeZarD commented 11 years ago

Hi again,

While trying to target mysql, I faced a problem at the table creation. In fact mysql needs a length for varchars.

So I tried to slip a limit into config files and an autolimit for varchars on mysql targets, I added some tests too.

I just draw your attention on the fact that the test are not similar to the previously done tests, and are tweaking around a little, so if you see a better to do this, I'm all ears ;-)

Cheers!

PiTiLeZarD commented 11 years ago

Actually, I'm thinking of going to MysqlDatabaseTarget solution which covers few exceptions, we figured that we can't use Float either, you get a Decimal(10, 0) as a result... There is probably other exceptions like this... What do you think?

bfaludi commented 11 years ago

I have some idea about the whole process. I would write a BaseDatabaseTarget class which could be used for PostgreSQL, sqllite, etc. Will be able to create MysqlDatabaseTarget as well and have the opportunity to create specific exceptions. I would modify the DatabaseTarget to work as a dispatcher and It would use the correct DatabaseTarget class based on the connection url. It would be simple i think and easy to expand. What do you think?

PiTiLeZarD commented 11 years ago

It's a really good Idea! How far are you with this idea? definitely can give a hand, I use SQLite and MySQL a lot with mETL recently ;-)

Right now I tweak around a lot cuz I need my project to run on friday, but I can get to a clean version starting from next week!