【问题标题】:Peewee Connection pooling with postgresql 9.4 and JSON fields support具有 postgresql 9.4 和 JSON 字段支持的 Peewee 连接池
【发布时间】:2015-07-20 15:13:22
【问题描述】:

知道 Peewee 中已经支持 connection pooling for Postgres,并且还支持 JSON fields in Postgres,我想知道 PooledPostgresqlDatabase 是否真的支持这些 JSON 字段,如果不支持如何我确实让它作为 PostgresqlExtDatabase 工作。

【问题讨论】:

    标签: python json connection-pooling peewee postgresql-9.4


    【解决方案1】:

    有一个名为 PooledPostgresqlExtDatabase 的类,它以 PostgresqlExtDatabase 的方式支持两个池,但支持连接池:

    from playhouse.pool import PooledPostgresqlExtDatabase
    
    db = PooledPostgresqlExtDatabase(
        'my_database',
        max_connections=8,
        stale_timeout=300,
        user='postgres')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-12-15
      • 2015-03-03
      • 1970-01-01
      • 1970-01-01
      • 2019-03-19
      • 2019-08-04
      • 1970-01-01
      • 2010-10-14
      相关资源
      最近更新 更多