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

Issue with scanning []byte field on struct #122

Closed
tsmethurst opened this issue Aug 26, 2021 · 2 comments · Fixed by #125
Closed

Issue with scanning []byte field on struct #122

tsmethurst opened this issue Aug 26, 2021 · 2 comments · Fixed by #125

Comments

@tsmethurst
Copy link

I can insert a struct with a field called Auth that's []byte, with the annotation bun:"type:bytea,notnull", however when i try to retrieve the same struct using a NewSelect().......Scan(ctx) I get the following error:

sql: Scan error on column index 1, name "auth": invalid character '\\' looking for beginning of value

This used to work fine in go-pg. Could it be an issue introduced in Bun?

I'm using off-the-shelf Postgres, and I see the issue in both of the Postgres drivers recommended in the Bun documentation.

@tsmethurst
Copy link
Author

Just to add some more info: if i use Exec() instead of Scan() I get no errors, but the struct that's returned is just empty.

@vmihailenco
Copy link
Member

Thanks for the report. This should be fixed in master branch and will be released shortly.

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

Successfully merging a pull request may close this issue.

2 participants