deutschmarco / sqlautocode

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

AttributeError: 'SQLiteDialect_pysqlite' #32

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Using sqlautocode 0.6.6

Trying to inspect a sqlite database:

$ sqlautocode sqlite:///photos.db -o db.py
Starting...
Traceback (most recent call last):
  File "/home/mathieu/Work/python-fspot/env/bin/sqlautocode", line 9, in <module>
    load_entry_point('sqlautocode==0.6b1', 'console_scripts', 'sqlautocode')()
  File "/home/mathieu/Work/python-fspot/env/lib/python2.6/site-packages/sqlautocode-0.6b1-py2.6.egg/sqlautocode/main.py", line 41, in main
    reflection_schema = db.dialect.get_default_schema_name(conn)
AttributeError: 'SQLiteDialect_pysqlite' object has no attribute 
'get_default_schema_name'

$ ls -l photos.db 
-rw-r--r-- 1 mathieu mathieu 0 2011-01-24 10:31 photos.db

Original issue reported on code.google.com by leplat...@gmail.com on 24 Jan 2011 at 10:20

GoogleCodeExporter commented 9 years ago
Just realized my last command could be misinterpreted. 
I have the same result if the photos.db file is not empty.

Original comment by leplat...@gmail.com on 24 Jan 2011 at 10:24

GoogleCodeExporter commented 9 years ago
I have the same issue with a catalog beeing created by Adobe Lightroom 3

Macintosh-4:Downloads be$ sqlautocode 
sqlite:////Users/be/Desktop/Photos2010/Photos2010-2.lrcat 
Starting...
Traceback (most recent call last):
  File "/usr/local/bin/sqlautocode", line 8, in <module>
    load_entry_point('sqlautocode==0.6b1', 'console_scripts', 'sqlautocode')()
  File "build/bdist.macosx-10.6-universal/egg/sqlautocode/main.py", line 41, in main
AttributeError: 'SQLiteDialect_pysqlite' object has no attribute 
'get_default_schema_name'
Macintosh-4:Downloads be$ 

Original comment by bernhard...@mac.com on 5 Feb 2011 at 11:43

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I also encountered the SAME error.
> sqlautocode mysql://user:pswd@hostname:3306/schema_name -o tables.py
Starting...
Traceback (most recent call last):
  File "F:py26/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 41, in main
AttributeError: 'SQLiteDialect_pysqlite' object has no attribute 
'get_default_schema_name'

Pl. help.
Thanks,
vineet.deodhar (at) gmail (dot) com

Original comment by vineet.d...@gmail.com on 15 Feb 2011 at 9:02

GoogleCodeExporter commented 9 years ago
The issue may be fixed. Find the main.py file and patch it:

srv-main:~ # diff main.py main.py_patched 
45c45,47
<     tablenames = db.dialect.table_names(conn, reflection_schema)
---
>     if not reflection_schema:
>         reflection_schema = None
>     tablenames = db.dialect.get_table_names(conn, reflection_schema)

Usage:

sqlautocode --declarative --schema= sqlite:///run/forum/data.sqlite3 > 
modules/data/forum/tables.py

Original comment by vintoz...@gmail.com on 28 Apr 2011 at 11:32