Conversation
| /// See also: | ||
| /// <https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/result-set-metadata> | ||
|
|
||
| pub trait AsyncResultSetMetadata: AsStatementRef { |
There was a problem hiding this comment.
This trait is basically 1:1 ResultSetMetadata trait with implementation tweaks to account for methods that are async
There was a problem hiding this comment.
So far I dodged thinking about async traits and their implications. Especially whether I can safely claim the resulting futures to be Send. I doged this issue so far by having BlockCursorPolling not implementing any Cursor trait, but just offering everything directly in the implementation. Yet I can also see Rust made some advances in async support since I last touched the issue.
Since there are many ways to implement asynchronous behavior in ODBC I would probably prefer the prefix Polling instead of Async.
Since this would require many tests I would also fine contributing and reviewing this trait in multiple steps, splitting among supported functions.
| let lazy_statement = move || self.allocate_statement(); | ||
| let lazy_statement = move || { | ||
| self.allocate_statement().and_then(|mut stmt| { | ||
| stmt.set_async_enable(true).into_result(&stmt)?; |
There was a problem hiding this comment.
flyby: shouldn't this implementation set the statement to be async?
| let mut ret = (f)(); | ||
| // Wait for operation to finish, using polling method | ||
| while matches!(ret, SqlResult::StillExecuting) { | ||
| info!("Waiting for operation to finish."); |
Adds support for async metadata, which is required for async support in arrow-odbc.
See #578 for more context.