-
Notifications
You must be signed in to change notification settings - Fork 97
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(go/adbc): implement ADBC 1.1.0 features #700
feat(go/adbc): implement ADBC 1.1.0 features #700
Conversation
61e2aac
to
5aa6a92
Compare
23066de
to
e5371a9
Compare
Code: adbc.StatusInvalidArgument, | ||
} | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func (d *database) GetOption(key string) (string, error) { |
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.
Do we want to default implement this with all the options that are accepted in SetOptions
?
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.
Yeah, I'm actually working on that now, for this and the Snowflake driver. I was originally going to do one PR per feature but at this rate it's just going to be a mega PR.
e5371a9
to
f6aa17b
Compare
3963459
to
6c9cc86
Compare
Updated:
|
I think I might remove the Cancellable interface from Go, since we already have context.Context. Instead, I'll have the FFI bridge track the last context it's using, and it can implement StatementCancel() or ConnectionCancel() based on that. |
742af71
to
7f7f11b
Compare
Update:
|
7f7f11b
to
237f2f0
Compare
OK, I think things are generally complete here (except for the XDBC info). If this is good, I'll port it to the driver template as well. |
237f2f0
to
e1c6991
Compare
Updated to fix the GetStatistics schema. |
go/adbc/adbc.go
Outdated
// the error message. The encoding of the data is driver-defined. It is | ||
// suggested to use proto.Message for Protocol Buffers and error for wrapped | ||
// errors. | ||
Details []interface{} |
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.
why the switch to use interface{}
instead of []byte
? it's a bit more difficult to convert this to something usable for a C error struct for an interface{}
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.
~Mostly so that we could keep strong typing for things like Protobufs, otherwise we would be forced to serialize them here. I'm sort of ambivalent here.
While working on Java, I also made this an array of key-value pairs; I plan to port that change here too.
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 would [](pair of key, []byte)
be preferable?
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.
you can use the proto.Message
interface potentially and then just serialize them later when necessary?
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 don't want to elevate gRPC too much, though
Is the shape of the API reasonable? I'd like to tackle the FFI bridge soon |
go/adbc/driver/flightsql/utils.go
Outdated
@@ -71,5 +73,7 @@ func adbcFromFlightStatus(err error) error { | |||
return adbc.Error{ | |||
Msg: err.Error(), | |||
Code: adbcCode, | |||
// slice of proto.Message or error | |||
Details: grpcStatus.Details(), |
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.
it looks like the details themselves are effectively proto.Message
interfaces that we could leverage?
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, that's why I made it interface{} so we can easily return them directly without forcing apps to serialize/deserialize them
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.
ideally i'd prefer to be explicit on the interface type and use proto.Message
rather than interface{}
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.
Trying to wrap this up, now it's behind an interface with wrappers for Protobuf messages.
8a14461
to
1c6cab9
Compare
- ADBC_INFO_DRIVER_ADBC_VERSION - StatementExecuteSchema (apache#318) - ADBC_CONNECTION_OPTION_CURRENT_{CATALOG, DB_SCHEMA} (apache#319) - Get/SetOption - error_details (apache#755) - GetStatistics (apache#685) - New ingest modes (apache#541)
1c6cab9
to
3466e2e
Compare
If this looks reasonable, I'd like to merge then start on updating driver.go.tmpl |
AdbcStatementExecuteSchema
#318)