• SQLAutoCode


    I'm trying to auto generate a schema for use in SQLalchemy, I'm using sqlautocode to do this, I use the following command

    D:~ admin$ sqlautocode mysql://'user':"pass"@xx.xx.xx.xx:3306/db_name -o tables.py

    but I keep getting the following error..

    Traceback (most recent call last):
      File "/usr/local/bin/sqlautocode", line 9, in <module>
    load_entry_point('sqlautocode==0.7', 'console_scripts', 'sqlautocode')()
      File "/Library/Python/2.7/site-packages/distribute-0.6.45-py2.7.egg/pkg_resources.py", line 343, in load_entry_point
      return get_distribution(dist).load_entry_point(group, name)
      File "/Library/Python/2.7/site-packages/distribute-0.6.45-py2.7.egg/pkg_resources.py", line 2354, in load_entry_point
    return ep.load()
      File "/Library/Python/2.7/site-packages/distribute-0.6.45-py2.7.egg/pkg_resources.py", line 2060, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
     File "/Library/Python/2.7/site-packages/sqlautocode/main.py", line 4, in <module>
    from declarative import ModelFactory
     File "/Library/Python/2.7/site-packages/sqlautocode/declarative.py", line 17, in <module>
    from sqlalchemy.ext.declarative import _deferred_relation as _deferred_relationship
    ImportError: cannot import name _deferred_relation

    Use sqlacodegen instead:

    D:~ admin$ sqlacodegen mysql://'users':"pass"@xx.xx.xx.xx:3306/db_name --outfile tables.py

  • 相关阅读:
    Eclipse快捷键大全
    OOA/OOD/OOP
    SQL Server 存储过程(转)
    PowerDesigner 生成数据库方法(转)
    CDM和PDM的区别?(转)
    委托存在的理由
    提问回顾
    对软件工程常见概念的一些见解
    Gulp插件笔记
    Pascal-S代码注释
  • 原文地址:https://www.cnblogs.com/turingbrain/p/5419476.html
Copyright © 2020-2023  润新知