-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async metadata support #577
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flyby: shouldn't this implementation set the statement to be async?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch: Fixed in 8.1.2
@@ -33,6 +35,7 @@ where | |||
let mut ret = (f)(); | |||
// Wait for operation to finish, using polling method | |||
while matches!(ret, SqlResult::StillExecuting) { | |||
info!("Waiting for operation to finish."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using this to debug #578
Adds support for async metadata, which is required for async support in arrow-odbc.
See #578 for more context.