What .Net orms or MicroOrms support async operations and PostgreSql

后端 未结 7 1883
太阳男子
太阳男子 2021-01-18 06:25

What ORM\'s support async operations and postgresql ?

I prefer simple MicroOrms like Dapper and OrmLite because they seems to have great performance and they are rea

相关标签:
7条回答
  • 2021-01-18 06:30

    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.

    0 讨论(0)
  • 2021-01-18 06:31

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

    0 讨论(0)
  • 2021-01-18 06:37

    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.

    0 讨论(0)
  • 2021-01-18 06:38

    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.

    0 讨论(0)
  • 2021-01-18 06:51

    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.

    0 讨论(0)
  • 2021-01-18 06:56

    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...

    0 讨论(0)
提交回复
热议问题