Chlorus / sqlautocode

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

not compatible with sqlalchemy 0.6.5 #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. install sqlalchemy 0.6.5
2. run sqlautocode uri 
3. AttributeError db.dialect.table_names get_default_schema_name not defined.

It seems like sqlalchemy has changed its api.
I don't use older version of sqlalchemy, so i've made changes for myself, i 
guess you need to add version checking, i hope this patch can give some help.

--- a/sqlautocode/main.py   Tue Oct 05 16:12:10 2010 -0600
+++ b/sqlautocode/main.py   Mon Oct 18 12:43:55 2010 +0800
@@ -38,11 +38,11 @@
         reflection_schema=options.schema
     else:
         try:
-            reflection_schema = db.dialect.get_default_schema_name(conn)
+            reflection_schema = db.dialect._get_default_schema_name(conn)
         except NotImplementedError:
             reflection_schema = None

-    tablenames = db.dialect.table_names(conn, reflection_schema)
+    tablenames = db.dialect.get_table_names(conn, reflection_schema)

     # fixme: don't set up output until we're sure there's work to do!
     if options.tables:

Original issue reported on code.google.com by yi.codep...@gmail.com on 18 Oct 2010 at 4:52

GoogleCodeExporter commented 9 years ago
Also I had to make some changes in declarative.py

Each _deferred_relation and RelationProperty 
has to be _deferred_relationship and RelationshipProperty

Original comment by mike.dob...@gmail.com on 27 Oct 2010 at 2:22

GoogleCodeExporter commented 9 years ago
Fixed in trunk - will make it into 0.6 final

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