- attached mysql_py_autoload_keys.patch
Autoload indexes in mysql
The mysql table autoload currently does not load the indexes.
The attached patch provide this feature. I have tested it on a 140+ tables database with various indexes (unique, non unique, single or multi columns).
Comments (8)
-
Account Deleted -
repo owner just curious, what are you using this feature for ? are you using it to make a "copy" of a schema elsewhere ?
-
Account Deleted Replying to zzzeek:
just curious, what are you using this feature for ? are you using it to make a "copy" of a schema elsewhere ?
Basically yes.
I have a legacy db in mysql, and I want to make, with an improved autocode.py (which I'll post on the group after a little code cleaning), a complete definition so I can work on a new backend in python.
Since there is a lot of foreign keys and I need to support MSSQL, a lot of indexes are mandatory... and I don't want to do this manually.
The remaining indexes are here for performances, so keeping them at no cost is a good thing.
-
- changed milestone to 0.4.0
The 0.4 branch will have complete mysql reflection & re-creation capabilities shortly.
-
repo owner Replying to guest:
Basically yes.
I have a legacy db in mysql, and I want to make, with an improved autocode.py (which I'll post on the group after a little code cleaning), a complete definition so I can work on a new backend in python.
you might have more problems with that, since the reflected table is going to have all MySQL TypeEngine objects embedded into it. they wont create on MS-SQL properly.
-
Account Deleted Replying to zzzeek:
Replying to guest:
Basically yes.
I have a legacy db in mysql, and I want to make, with an improved autocode.py (which I'll post on the group after a little code cleaning), a complete definition so I can work on a new backend in python.
you might have more problems with that, since the reflected table is going to have all MySQL TypeEngine objects embedded into it. they wont create on MS-SQL properly.
My modified autocode.py (I'll post it by the next hour now) does replace the MsSQL Types by the standards ones. The overall process works and I successfully created the MSSQL version of my database, with foreign keys and indexes, from the generated definition. One thing though, I couldn't use create_all() because of the foreign keys, I had to customize the creation order of the tables.
-
- changed status to resolved
indexes are reflected in 7a545a886973d76f934e0c234b69be8938cc9b20. more information is now being reflected than can currently be shoved into an Index- rounding out support as Index allows can be an incremental process.
-
repo owner - removed milestone
Removing milestone: 0.4.0 (automated comment)
- Log in to comment
patch against mysql.py from 0.3.9 release