English 中文(简体)
• 如何在诺德两地支持邮政总局和服务器。 JS application?
原标题:How to support both PostgreSQL and SQL Server in a Node.JS application?

I m目前正在开发一个Node.js, 认为需要能够在PogreSQL和服务器数据库之间转用。 两个数据库都有相同的表格,业务也将相同(基本团结和团结联盟,无所作为)。

我进行了研究,并知道周围有足够的图书馆可以查阅这两个数据库。

理想的情况是,我要利用一个办公室,让它处理分歧。 然而,我似乎无法找到一个既有效的人力资源管理框架。 事实上,我可以找到任何能够支持服务器的投管处,而几乎所有的支持都是邮政局。

So my question: is there an ORM that supports both? And if there isn t, are there other abstraction tools/frameworks around that will make my developer life easier?

问题回答

There is a certain amount of YAGNI here, but if you are unable to find an ORM that supports both, your next best bet is to just use an Adapter Pattern and ensure you re not using the ORM directly in your code, but through a wrapper. Then if / when you need support for SQL Server, you can create the implementation for the wrapper which will replace the PostgreSQL implementation.





相关问题
摘录数据

我如何将Excel板的数据输入我的Django应用? I m将PosgreSQL数据库作为数据库。

Postgres dump of only parts of tables for a dev snapshot

On production our database is a few hundred gigabytes in size. For development and testing, we need to create snapshots of this database that are functionally equivalent, but which are only 10 or 20 ...

How to join attributes in sql select statement?

I want to join few attributes in select statement as one for example select id, (name + + surname + + age) as info from users this doesn t work, how to do it? I m using postgreSQL.

What text encoding to use?

I need to setup my PostgreSQL DB s text encoding to handle non-American English characters that you d find showing up in languages such as German, Spanish, and French. What character encoding should ...

SQL LIKE condition to check for integer?

I am using a set of SQL LIKE conditions to go through the alphabet and list all items beginning with the appropriate letter, e.g. to get all books where the title starts with the letter "A": SELECT * ...

热门标签