【问题标题】:What is a default transaction isolation level in sqlalchemy for Postgres?Postgres 的 sqlalchemy 中的默认事务隔离级别是什么?
【发布时间】:2020-12-02 04:31:03
【问题描述】:

我将 sqlalchemy 用于 Postgres DB。

engine = create_engine(
    "postgresql://postgres:postgres@localhost/test"

...

创建没有 Postgres 方言(psycopg2、pg8000 或其他)的引擎。所以我的问题是:什么是默认事务隔离级别?什么是默认的 Postgres 方言?

【问题讨论】:

    标签: python postgresql sqlalchemy


    【解决方案1】:

    根据the docs,SQLAlchemy 使用的默认 postgres 驱动程序是 psycopg2。

    默认事务隔离级别是在 DB 端配置的,而不是由客户端配置的。开箱即用,it is READ COMMITTED

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-14
      • 2010-09-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-24
      相关资源
      最近更新 更多