Support For ExecuteNonQueryAsync, ExecuteReaderAsync, ExecuteScalarAsync
Support For ExecuteNonQueryAsync, ExecuteReaderAsync, ExecuteScalarAsync
Does Dotconnect support these methods? I see they are supported in the 'System.Data.Common.DbCommand' class. The only methods I see in the library are the 'BeginExecuteReader' and 'EndExecuteReader' methods which require a bit of work to get implemented correctly rather than 'await sqCommand.ExecuteScalarAsync()'. If the library does not have those method could we please get them added if possible.
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Support For ExecuteNonQueryAsync, ExecuteReaderAsync, ExecuteScalarAsync
The ExecuteNonQueryAsync, ExecuteReaderAsync, ExecuteScalarAsync methods were added in the .NET Framework 4.5. dotConnect for SQLite is built with .NET Framework 2.0 and does not have the ExecuteNonQueryAsync, ExecuteReaderAsync, and ExecuteScalarAsync methods.
Currently, SQLiteCommand implements async execution of the ExecuteReader and ExecuteNonQuery methods. For more information, please refer to http://www.devart.com/dotconnect/sqlite ... mbers.html
You can read more on asynchronous query execution in our documentation: http://www.devart.com/dotconnect/sqlite ... onous.html
Please tell us if implementing BeginExecuteScalar and EndExecuteScalar in the same way as BeginExecuteReader and EndExecuteReader would be suitable for you.
Currently, SQLiteCommand implements async execution of the ExecuteReader and ExecuteNonQuery methods. For more information, please refer to http://www.devart.com/dotconnect/sqlite ... mbers.html
You can read more on asynchronous query execution in our documentation: http://www.devart.com/dotconnect/sqlite ... onous.html
Please tell us if implementing BeginExecuteScalar and EndExecuteScalar in the same way as BeginExecuteReader and EndExecuteReader would be suitable for you.
Re: Support For ExecuteNonQueryAsync, ExecuteReaderAsync, ExecuteScalarAsync
So are you saying SQLiteCommand already supports the ExecuteReaderAsync and ExecuteNonQueryAsync methods meaning, I can just call "await ExecuteNonQueryAsync()" or do I have to implement the BeginExecuteNonQuery and EndExecuteNonQuery methods?
Ideally, what I am looking to be able to do is call "await ExecuteNonQueryAsync()", "await ExecuteReaderAsync()" or "await ExecuteScalarAsync()" ...ect in one line without having to deal with the BEGIN and END methods at all.
Right now I am wrapping my ExecuteScalar and ExecuteNonQuery in a Task.Run method so It runs on a Thread Pool thread and not freeze my Main Thread if I am doing bulk inserts or heavy reads. I am using this library with a Windows Forms application. From my understanding most of the .NET Async methods that deal with IO use IO Completion Ports and not Thread Pool threads. I am hoping Async methods would eliminate my need for running my queries using Thread Pool threads.
Ideally, what I am looking to be able to do is call "await ExecuteNonQueryAsync()", "await ExecuteReaderAsync()" or "await ExecuteScalarAsync()" ...ect in one line without having to deal with the BEGIN and END methods at all.
Right now I am wrapping my ExecuteScalar and ExecuteNonQuery in a Task.Run method so It runs on a Thread Pool thread and not freeze my Main Thread if I am doing bulk inserts or heavy reads. I am using this library with a Windows Forms application. From my understanding most of the .NET Async methods that deal with IO use IO Completion Ports and not Thread Pool threads. I am hoping Async methods would eliminate my need for running my queries using Thread Pool threads.
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: Support For ExecuteNonQueryAsync, ExecuteReaderAsync, ExecuteScalarAsync
No, dotConnect for SQLite does not support such methods.Famous wrote:So are you saying SQLiteCommand already supports the ExecuteReaderAsync and ExecuteNonQueryAsync methods meaning, I can just call "await ExecuteNonQueryAsync()" or do I have to implement the BeginExecuteNonQuery and EndExecuteNonQuery methods?
We will analyze the possibility of using I/O Completion Ports for asynchronous command execution methods but there is no timeframe.Famous wrote:From my understanding most of the .NET Async methods that deal with IO use IO Completion Ports and not Thread Pool threads. I am hoping Async methods would eliminate my need for running my queries using Thread Pool threads.