根据这个问题,SQLAlchemy - 用于测试的 SQLite 和用于开发的 Postgresql - 如何移植?
我意识到,(以上)共识是不要使用未在生产中使用的数据库进行测试。
我想抽象对sqlalchemy的部分索引支持,这样我就可以使用 Postgres 或 Sqlite。
我已经看到了,PostgreSQL
我可以使用
Index('only_one_active_invoice',
invoice_id, active,
unique=True,
postgresql_where=(active)
),
但我看到https://sqlite.org/partialindex.html也支持部分索引sqlite
是否有某种对sqlalchemy的通用部分索引支持,我的模块可以用于 postgres 或 sqlite 数据库?