-
Notifications
You must be signed in to change notification settings - Fork 6
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: Rewriting the value parser #149
base: main
Are you sure you want to change the base?
Conversation
forsaken628
commented
Jan 21, 2025
- the old value parser did not conform to the standard library documentation. driver.Value should be a small number of types, and then the standard library implements conversions to a wider range of types.
- provide unknownColumnType for compatibility with newly added types.
- passes ttc integration tests.
- this PR supports fewer types than the previous one.
- need to add support for complex types. That is, add Struct, through the implementation of the Scanner interface, to complete the parsing driver.Value.
cc @flaneur2020 |
@@ -77,6 +77,10 @@ func (dc *DatabendConn) BeginTx( | |||
return &databendTx{dc}, nil | |||
} | |||
|
|||
func (dc *DatabendConn) DataParserOptions() *DataParserOptions { |
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.
is this required to be public to users?
if c.checkNull(s) { | ||
return nil, nil | ||
} | ||
return time.ParseInLocation("2006-01-02 15:04:05.999999", s, time.UTC) |
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.
the timezone should be fetched from settings I think.
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.
But we don't have client side timezone, maybe we can keep it let it use UTC now.
I checked bendsql it's also using native date