-
Notifications
You must be signed in to change notification settings - Fork 62
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
Support read varbinary #76
base: master
Are you sure you want to change the base?
Conversation
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
README.md
Outdated
@@ -18,6 +18,7 @@ A [Trino](https://trino.io) client for the [Go](https://golang.org) programming | |||
* `float64`, `sql.NullFloat64` | |||
* `map`, `trino.NullMap` | |||
* `time.Time`, `trino.NullTime` | |||
* `[]byte`, `trino.NullVarbinary` |
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 think we use Go's data types in the names of these structures, so it would be trino.NullSliceByte
.
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.
Okay, I change it to NullSliceByte now
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
@@ -204,6 +205,8 @@ When passing arguments to queries, the driver supports the following Go data typ | |||
* the result of `trino.TimeTz(hour, minute, second, nanosecond, location)` - passed to Trino as a time with a time zone | |||
* the result of `trino.Timestamp(year, month, day, hour, minute, second, nanosecond)` - passed to Trino as a timestamp without a time zone | |||
|
|||
We can also implement driver.Valuer interface to return data of types above. |
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.
We can also implement driver.Valuer interface to return data of types above. | |
We can also implement the `driver.Valuer` interface to return data of the types above. |
@@ -246,6 +249,7 @@ To read query results containing arrays or maps, pass one of the following struc | |||
* `trino.NullSliceFloat64` | |||
* `trino.NullSliceTime` | |||
* `trino.NullSliceMap` | |||
* `trino.NullSliceByte` |
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.
Adding trino.NullSliceByte
here might be misleading, as it's used for VARBINARY
. This section is about arrays and maps, so ARRAY(VARBINARY)
will use trino.NullSlice2Byte
.
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.
Add VARBINARY
to the list in the beginning of this section, maybe after UUID
.
b.Valid = true | ||
|
||
var err error | ||
switch v := value.(type) { |
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.
Can the server really return []byte
here or is it always a base64 encoded string? If the latter, remove the switch statement.
Support read trino type "varbinary" as []byte