#5583·sqlalchemy

提高 SQLAlchemy 对数据库特定支持结构的一致性

作者: CaselIT创建于 2020年9月14日更新于 2026年9月3日
标签documentationsqlbig jobuse case
  1. 所有后端在接收到无法实现的用户行为意图时都应该抛出错误,因此首先,compiler.py中的for_update_clause()应该检查所有这些for_update标志并抛出错误,即,以下代码是错误的: def for_update_clause(self, select, **kw): return "FOR UPDATE" 应该是: def for_update_clause(self, select, **kw): if select._for_update_arg.read: raise exc.CompileError("read only for update is not supported by this backend") elif select._for_update_arg.of is not None: raise exc.CompileError("....") 或者 ... # 等等。 return "FOR UPDATE"

内容来源: sqlalchemy/sqlalchemy