unalloc / sqlautocode

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

Broken with cx_Oracle #38

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.
2. sqlautocode.exe oracle://user:pass@host/db -o model.py -s my_schema 
3. C:\Python27\Scripts>sqlautocode.exe oracle://my_user:my_pass@my_host/db_name 
-o mode
l.py -s MySchema
File "model.py" exists and will be overwritten.
Overwrite (y/[n]): y
Starting...
Traceback (most recent call last):
  File "C:\Python27\Scripts\sqlautocode-script.py", line 8, in <module>
    load_entry_point('sqlautocode==0.6b1', 'console_scripts', 'sqlautocode')()
  File "build\bdist.win32\egg\sqlautocode\main.py", line 45, in main
AttributeError: 'OracleDialect_cx_oracle' object has no attribute 'table_names'

C:\Python27\Scripts>

What is the expected output? What do you see instead?
a correctly formatted model.py file

What version of the product are you using? On what operating system?
sqlautocode 0.6b sqlalchemy 0.7.4 cx_Oracle 5.1.1 winxp python 2.7

Please provide any additional information below.
I think the script uses table_names to list all oracle tables, but there is no 
such function in oracle. :(

Original issue reported on code.google.com by la...@schwerzler.com on 18 Feb 2012 at 1:14

GoogleCodeExporter commented 8 years ago
Actually this is fixed in the current code. 

Line 45 of main should be changed from: 
tablenames = db.dialect.table_names(conn, reflection_schema)
to
tablenames = db.dialect.get_table_names(conn, reflection_schema)

Original comment by la...@schwerzler.com on 20 Feb 2012 at 3:31

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I am using the latest sqlautocode-0.6b1 and it is still broken but making the 
suggested change seems to work.

Original comment by ronsmit...@gmail.com on 30 Nov 2012 at 4:50