async/await all the way
See original GitHub issueI’m not sure if this project would benefit from async/await support.
I have the vague feeling that it might be better to go async/await, because DB-oriented libraries will go async-first (in the future) and simply use .Wait()
for the non-async functions. On the other hand, we’re usually not blocking the application/server, because the migrations will usually be done beforehand manually (migration tool) or at startup.
Here is what I found out about the ADO.NET providers:
ADO.NET provider | Version | Direct async support |
---|---|---|
FirebirdSql.Data.FirebirdClient | 6.0.0-beta1 | No |
Npgsql | 4.0.0-preview2 | Yes |
System.Data.SqlClient | 4.4.3 | Yes 1 |
System.Data.SQLite | 1.0.108 | No |
MySql.Data | 8.0.10-rc | No 2 |
Oracle.ManagedDataAccess | 12.2.1100 | No |
IBM.Data.DB2 | 11.1.3030.4 | No |
Sap.Data.Hana.v4.5 | 2.2.36.0 | No 3 |
1 Creates async tasks by wrapping the old-style Begin*
/End*
functions
2 Provides Begin*
/End*
functions for some platforms, but no *Async
functions
3 Provides Begin*
/End*
functions and (partially) *Async
, but executes the queries synchronously
Every ADO.NET provider gains some kind of async support through DbCommand
, but this might not be as performant as it could’ve been.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:18
Top GitHub Comments
So to conclue this: I will draft a proposal how async support could be realized. AS im currently very busy at my daytimer job, I doubt i can show something before next weekend.
I have found a use case for async/await:
In the terminal, Control+C to cancel the migration pipeline. Without a CancellationToken to pass, there is no good way other than closing the terminal to do this