zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    032 代码复用与函数递归
    031 实例7-七段数码管绘制
    030 函数的定义与使用
    029 函数和代码复用
    2.4 Buffer
    2.3 字符串链接
    2.2 去除字符串特别字符
    2.1 字符串查询
    存储数据_文件读写
    template模板
  • 原文地址:https://www.cnblogs.com/turingbrain/p/5419476.html
Copyright © 2011-2022 走看看