How can I use Dapper in a multi database environment?

dapper oracle sql sql-server

Question

I'm trying to implement simple queries like SELECT * FROM TABLE_X WHERE XID = @id, but the problem that I'm having is that these queries would run on different databases (SQL Server and Oracle) for different application instances.

How to do it without to have to write each database a new set of queries?

Popular Answer

Dapper is really closed to the database, and allow you to leverage pure sql tricks specific for a specific database. In my opinion you should use a query object pattern, so you will have an interface in front of each extraction /commit that would possibly change for SQL/Oracle.



Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why