juxj / sqlautocode

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

Traceback w/ recent release wrapping mysql tables. #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run against database w/o using schema option
2. here's the (anonymized) command from w/in the virtualenv

./bin/sqlautocode mysql://username:password@localhost/database_name -t
"member, person" -o ../members.py -g    

What is the expected output?

Expect it to output code to wrap tables (like it did before recent release)
into the member.py file.

What do you see instead?

Starting...
Traceback (most recent call last):
  File "./bin/sqlautocode", line 8, in <module>
    load_entry_point('sqlautocode==0.5.7', 'console_scripts', 'sqlautocode')()
  File "build/bdist.linux-x86_64/egg/sqlautocode/main.py", line 41, in main
AttributeError: 'MySQL_mysqldb' object has no attribute
'get_default_schema_name'

What version of the product are you using? On what operating system?

version 0.5.7 on Debian using a virtualenv with latest requirements pulled
from pypi.

Please provide any additional information below.

Looks like a simple typo/mistyped function name. Here is the line
referenced in the traceback.

            reflection_schema = db.dialect.get_default_schema_name(conn)

In the current sqlalchemy at least this method 'get_default_schema_name'
starts with an underscore. So adding that fixes the issue like thus.

            reflection_schema = db.dialect._get_default_schema_name(conn)

Original issue reported on code.google.com by eiken...@gmail.com on 10 Feb 2010 at 9:33

GoogleCodeExporter commented 9 years ago
Sorry, just noticed that pypi is giving me sqlalchemy 6.0beta1 instead of 5.8.
Comparing 6.0beta1 to 5.8 shows that this difference is the source of this bug, 
not
the new version of sqlautocode.

Please feel free to close this bug (I don't see a way to close this myself).

Original comment by eiken...@gmail.com on 10 Feb 2010 at 11:06

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
I am getting this with auto-code 0.6b1 and sqlalchemy 0.6.5 .
I am not sure I understand the resolution of this bug.  Does auto-code 0.6b1 
only work with sql alchemy 5.x ?

Original comment by emil.mac...@gmail.com on 15 Dec 2010 at 3:07