sqlautocode for mysql giving syntax error

683 Views Asked by At

I am using TG2.1 on WinXP. Python ver is 2.6. Trying to use sqlautocode (0.5.2) for working with my existing MySQL schema. SQLAlchemy ver is 0.6.6

import sqlautocode # works OK

While trying to reflect the schema ----

sqlautocode mysql:\\username:pswd@hostname:3306\schema_name -o tables.py

SyntaxError: invalid syntax is raised.

Can someone please point out what's going wrong, & how to handle the same?

Thanks, Vineet.

2

There are 2 best solutions below

0
On

Your issue may be the backslash "\" Try going from this:

sqlautocode mysql:\\username:pswd@hostname:3306\schema_name -o tables.py

to this:

sqlautocode mysql://username:pswd@hostname:3306/schema_name -o tables.py
0
On

Hey, I got it right somehow. The problem seems to be version mismatch between SA 0.6 & sqlautocode 0.6 Seems that they don't work in tandom. So I removed those & installed SA 0.5

Now it's working.

Thanks, Vineet Deodhar.