The size of the data in the database shouldn't matter, it runs mysql
to get the table list and then mysqldump on each table using the first
output.

This script needs some testing but the only way to test is pass more
databases through it. It works well on my particular DB but yours has
a new case that is a problem.

The key error comes when the regular expression at line 87 fails
resulting in the key lookup for the data type in data_type_map also
failing. Obviously '1' isn't a data type.

It would help if you added a

print line

statement after line 87 to capture the line that breaks and then a
mysqldump of the table that caused the break.

Ron

On Sep 16, 4:15 am, Johann Spies <johann.sp...@gmail.com> wrote:
> How do I use this script?
>
> I gave a fairly complex and relatively large database (few hunderd
> thousand records) to try and use with web2py.
>
> When I run this script (the version that came with 1.85.2)  I get:
>
> $ python extract_mysql_models.py user:pas...@kbase
> Traceback (most recent call last):
>   File "extract_mysql_models.py", line 106, in <module>
>     print mysql(m.group(3),m.group(1),m.group(2))
>   File "extract_mysql_models.py", line 92, in mysql
>     web2py_table_code += "\n    
> Field('%s','%s'),"%(name,data_type_map[d_type])
> KeyError: '1'
>
> Regards
> Johann
> --
>     "The fool hath said in his heart, There is no God..."
>                                Psalm 14:1

Reply via email to