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 Server 的嵌套过程中处理事务? 2021-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- SQL Server 2016更改对象所有者 2022-01-01
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01