-
Notifications
You must be signed in to change notification settings - Fork 94
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
feat(rust/driver/snowflake): add adbc_snowflake
crate with Go driver wrapper
#2207
base: main
Are you sure you want to change the base?
Conversation
@@ -24,6 +24,15 @@ dependencies = [ | |||
"arrow-select", | |||
] | |||
|
|||
[[package]] | |||
name = "adbc_snowflake" | |||
version = "0.15.0" |
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.
probably need to update the release scripts somehow to make sure that we automatically update this upon releases and such.
type Option = OptionConnection; | ||
|
||
fn set_option(&mut self, key: Self::Option, value: OptionValue) -> Result<()> { | ||
self.0.set_option(key, value) | ||
} | ||
|
||
fn get_option_string(&self, key: Self::Option) -> Result<String> { | ||
self.0.get_option_string(key) | ||
} | ||
|
||
fn get_option_bytes(&self, key: Self::Option) -> Result<Vec<u8>> { | ||
self.0.get_option_bytes(key) | ||
} | ||
|
||
fn get_option_int(&self, key: Self::Option) -> Result<i64> { | ||
self.0.get_option_int(key) | ||
} | ||
|
||
fn get_option_double(&self, key: Self::Option) -> Result<f64> { | ||
self.0.get_option_double(key) | ||
} | ||
} |
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.
I'm not familiar enough with Rust, but can't these just be inherited somehow from a base type instead of having to implement them here?
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.
Yes, we should be using traits for this. Discussed before here: #1725 (comment).
I'll try to put up a PR to change these option structs to traits following the proposal in #1725 (comment).
This PR adds the
adbc_snowflake
crate to the Rust workspace. This crate provides a Snowflake ADBC driver for Rust by wrapping the Go driver, loaded by the Rust driver manager implementation. Thebuild.rs
script builds the Go driver and links it statically.