推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
wuwukai007
V2EX  ›  Python

Python -sql 这个库有大佬用过的吗, tuple(select) 解析 sql 巨慢,一条普通 sql 解析要 1s

  •  
  •   wuwukai007 · May 4, 2021 · 1956 views
    This topic created in 1836 days ago, the information mentioned may be changed or developed.

    构造出 sql.Select 类,然后 tuple(select) 解析成字符串 sql,巨慢,看他源码里面父类迭代器

    def __iter__(self):
        yield str(self)
        yield self.params
    
    

    一头雾水,也不知道怎么调试,断点也打不进去

    Supplement 1  ·  May 4, 2021
    2 replies    2021-05-05 03:11:02 +08:00
    zagfai
        1
    zagfai  
       May 4, 2021
    这些都是越搞越复杂。。。 没啥意义
    no1xsyzy
        2
    no1xsyzy  
       May 5, 2021
    你分别调试 str(select) 和 select.params 啊
    yield 会跳出当前栈帧但不释放,随后再回到栈帧,何时回当前函数是不确定的,所以不方便调试。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5457 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 05:52 · PVG 13:52 · LAX 22:52 · JFK 01:52
    ♥ Do have faith in what you're doing.