You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Try to fetch a row from a table that has a TIMESTAMP_LTZ or other date/time column type and make sure the value in the table for that column is null. Use the scan method to fetch the row and provide a *time.Time destination to scan the value of the column into.
What should happen?
Provide a NullTime type as provided by other drivers
What's happening?
unsupported Scan, storing driver.Value type into type *time.Time
The text was updated successfully, but these errors were encountered:
smtakeda
added
bug
Erroneous or unexpected behaviour
enhancement
The issue is a request for improvement or a new feature
jira
copied to JIRA
and removed
bug
Erroneous or unexpected behaviour
labels
Nov 14, 2019
The way I am trying to get around is by defining my own NullTime type but feel that the driver should provide this type and do the conversion etc... if needed.
type NullTime struct {
Time time.Time
Valid bool // Valid is true if Time is not NULL
}
// Scan implements the Scanner interface for NullTime
func (nt *NullTime) Scan(value interface{}) error {
if value == nil {
nt.Time, nt.Valid = time.Time{}, false
return nil
}
switch v := value.(type) {
case time.Time:
// . snowflake already has converted to time.Time
nt.Time, nt.Valid = v, true
return nil
}
return fmt.Errorf("Can't convert %T to time.Time", value)
}
Why Snowflake needs to introduce it now? In my understanding, NullTime was added to other drivers, because it didn't exist before. Now why not upgrading Go to 1.13? Do I miss something? Can you please elaborate your use case?
Issue description
Try to fetch a row from a table that has a TIMESTAMP_LTZ or other date/time column type and make sure the value in the table for that column is null. Use the scan method to fetch the row and provide a *time.Time destination to scan the value of the column into.
What should happen?
Provide a NullTime type as provided by other drivers
What's happening?
unsupported Scan, storing driver.Value type into type *time.Time
The text was updated successfully, but these errors were encountered: