SQLAlchemy - SQLite for testing and Postgresql for development - How to port?(SQLAlchemy - 用于测试的 SQLite 和用于开发的 Postgresql - 如何移植?)
问题描述
我想在我的所有测试中使用 sqlite 内存数据库,在我的开发/生产服务器上使用 Postgresql.
I want to use sqlite memory database for all my testing and Postgresql for my development/production server.
但是两个数据库中的 SQL 语法并不相同.例如:SQLite 有自动增量,而 Postgresql 有串行
But the SQL syntax is not same in both dbs. for ex: SQLite has autoincrement, and Postgresql has serial
将 SQL 脚本从 sqlite 移植到 postgresql 是否容易...您的解决方案是什么?
Is it easy to port the SQL script from sqlite to postgresql... what are your solutions?
如果您要我使用标准 SQL,我应该如何在两个数据库中生成主键?
If you want me to use standard SQL, how should I go about generating primary key in both the databases?
推荐答案
不要这样做.不要在一种环境中测试并在另一种环境中发布和开发.您使用此流程要求有错误的软件.
Don't do it. Don't test in one environment and release and develop in another. Your asking for buggy software using this process.
这篇关于SQLAlchemy - 用于测试的 SQLite 和用于开发的 Postgresql - 如何移植?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:SQLAlchemy - 用于测试的 SQLite 和用于开发的 Postgresql - 如何移植?


- 在SQL中,如何为每个组选择前2行 2021-01-01
- SQL 临时表问题 2022-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 更改自动增量起始编号? 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01