Skip to content
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

Trino VARBINARY columns should scan to []byte slices instead of strings. #60

Open
ademille opened this issue Nov 8, 2022 · 1 comment

Comments

@ademille
Copy link

ademille commented Nov 8, 2022

Trino columns that are VARBINARY type are base64 encoded before being sent via HTTP to the go client. The current client implementation scans the data into a 'string' type without base64 decoding the values, forcing the user of the driver to do an extra non-intuitive base64 decode to get the original binary data back.

It would be better to have the driver perform the base64 decode and return a []byte slice.
For example, if an IP address or MAC address is stored as a varbinary column in trino, the client could return a []byte type which could be used to create a net.IP or net.HardwareAddr directly.

@fatpa
Copy link

fatpa commented Aug 18, 2023

use from_utf8({varbinary_data}) function can return base64 decode data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants