deutschmarco / sqlautocode

Automatically exported from code.google.com/p/sqlautocode
Other
0 stars 0 forks source link

Using sqlautocode with SQLAlchemy 0.6beta3 #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. install MySQLdb 1.2.2 (from exe)
2. easy_install sqlalchemy -> 0.6beta3
3. easy_install sqlautocode -> 0.5.7
4. sqlautocode %DB_URL% -o out.py

What is the expected output? What do you see instead?
I expected that
 a) the documentation would be kept up-to-date [1]
 b) easy_installing a package would work out-of-the-box.
instead I got tons of import errors...

What version of the product are you using? On what operating system?
Windows XP-SP3-32bit, Python 2.5.4
1. MySQLdb 1.2.2 (from exe)
2. sqlalchemy -> 0.6beta3
3. sqlautocode -> 0.5.7

Please provide any additional information below.
To patch sqlautocode, I had to:
1. change main.py:41 to [1]:
    reflection_schema = db.dialect._get_default_schema_name(conn)
   and main.py:45 to:
    tablenames = db.dialect.get_table_names(conn, reflection_schema)
2. change declarative.py:11 to:
    from sqlalchemy.ext.declarative \
    import declarative_base, _deferred_relationship
   and declarative.py:12 to:
    from sqlalchemy.orm import relation, \
    backref, class_mapper, RelationshipProperty, Mapper
   also, you have to replace:
    _deferred_relation with _deferred_relationship
   and
    RelationProperty with RelationshipProperty

Can someone please make these changes to trunk, test it with other dialects  
and publish a new version to PyPI?

Thanks,

    Jussi

[1] http://code.google.com/p/sqlautocode/issues/detail?id=15

Original issue reported on code.google.com by jussiku...@gmail.com on 15 Apr 2010 at 6:48

GoogleCodeExporter commented 9 years ago
Sorry, this is probably a duplicate of issue #24
http://code.google.com/p/sqlautocode/issues/detail?id=24

There's a patch waiting - please merge it.

Original comment by jussiku...@gmail.com on 15 Apr 2010 at 6:50

GoogleCodeExporter commented 9 years ago
Should be fixed - uploaded to pypi as beta - please test

Original comment by spamsch@gmail.com on 30 Oct 2010 at 1:42