标签: python-2.7 peewee
我正在使用Python的peewee ORM和MYSQL。我想列出PooledDatabase的活动连接。有没有办法列出..?
答案 0 :(得分:2)
你是什么意思“活跃”?在被线程“检出”时是活动的,还是在“与数据库连接”中是活动的?
首先,您只需pooled_db._in_use。
pooled_db._in_use
对于第二个,它有点棘手 - 基本上它将是pooled_db._in_use(一个字典)和pooled_db._connections(一堆)的组合。
pooled_db._connections