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

When parsing database data, should []byte always be parsed??? #251

Open
shuqingzai opened this issue Oct 4, 2024 · 1 comment
Open

When parsing database data, should []byte always be parsed??? #251

shuqingzai opened this issue Oct 4, 2024 · 1 comment
Labels
Question Indicates that an issue, pull request, or discussion needs more information

Comments

@shuqingzai
Copy link

在使用一些复杂的 SQL 时,如:时间分组、自定义字段等,非基础类型的字段值通常会被设置为 []byte ,我们需要自行实现 Scanner 接口解析其值,但是在 carbon 中,只解析值为 time.Time 类型,并未解析 []byte ,导致使用复杂 SQL 时,无法实现解析

See: https://github.com/golang-module/carbon/blob/165bda517b50bc3fd41f952c0d53c7478fbf2db3/database.go#L10-L21

image

@shuqingzai shuqingzai added the Question Indicates that an issue, pull request, or discussion needs more information label Oct 4, 2024
@Issues-translate-bot Issues-translate-bot changed the title 解析数据库数据时,是否应该始终解析 []byte ??? When parsing database data, should []byte always be parsed??? Oct 4, 2024
@shuqingzai shuqingzai changed the title When parsing database data, should []byte always be parsed??? When parsing database data, should []byte always be parsed??? Oct 5, 2024
@gouguoyin
Copy link
Collaborator

Please provide a complex SQL example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Indicates that an issue, pull request, or discussion needs more information
Projects
None yet
Development

No branches or pull requests

2 participants