What .Net orms or MicroOrms support async operations and PostgreSql

风流意气都作罢 提交于 2019-12-01 16:42:16

If you are using .NET 4.5, I wrote a fork of Dapper that adds async methods that internally call ExecuteReaderAsync. It is also available on NuGet. I haven't tested it with Postgresql but if Dapper works with it then my fork should as well.

Just stumbled upon this new ORM called Insight.Database and they claim to support async queries:

List<Beer> beerMenu = await Database1.AsyncQuery<Beer>("FindBeer", new { Name = "Sly Fox" });

I did not try it yet...

Telerik's free OpenAccess ORM supports PostgeSQL, but I can't see anything mentioned about async. Maybe you could contact them, their online support is pretty good.

Insight.Database has full async support and works with any .NET SqlProvider. I haven't specifically tested it on postgres, but if you post an issue on the github site, I'd gladly incorporate postgres into the test suite.

https://github.com/jonwagner/Insight.Database

EDIT: Insight v3.0 and later supports most databases.

AsyncPoco, a fork of PetaPoco, supports asynchronous operations (exclusively) and PostgeSQL.

Dapper has had async support for some time, but only when targeting .NET 4.5. I could probably back-port to 4.0 using the BCL async targeting pack, but to date: I have not done so.

AFAIK the only RDBMS which natively supports asynchronous executions, provider side and server side (not fake ones like wrapping a call with a Task.Run()) on its reader, is SQL Server. You can see this by decompiling the specific ADO.NET data provider. The default implementation of ExecuteReaderAsync calls internally the synchronous one, if not overridden. Please double check by decompiling the specific ADO.NET provider because you may end up in doing database operations in the UI thread when using async and await.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!