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

bug: Bad formatting for time.Time named arg #206

Closed
candiduslynx opened this issue Apr 10, 2024 · 0 comments · Fixed by #207
Closed

bug: Bad formatting for time.Time named arg #206

candiduslynx opened this issue Apr 10, 2024 · 0 comments · Fixed by #207

Comments

@candiduslynx
Copy link
Contributor

When trying to pass an sql.NamedArg{Name: "syncTime", Value: msg.SyncTime} to ExecContext I got

[INVALID_PARAMETER_MARKER_VALUE.INVALID_VALUE_FOR_DATA_TYPE] An invalid parameter mapping was provided: the value '2024-04-10 11:44:13.011238 +0000 UTC' for parameter 'syncTime' cannot be cast to TIMESTAMP because it is malformed.

I can bypass it by using dbsql.Parameter{Name: "syncTime", Type: dbsql.SqlTimestamp, Value: msg.SyncTime.Format(time.RFC3339Nano)}, however, IMO this should be done by the SDK in here:

param.Value = value.String()

via

param.Value = value.Format(time.RFC3339Nano)
kravets-levko pushed a commit that referenced this issue Apr 10, 2024
Closes #206

Signed-off-by: candiduslynx <candiduslynx@gmail.com>
esdrasbeleza pushed a commit to esdrasbeleza/databricks-sql-go that referenced this issue Apr 15, 2024
Closes databricks#206

Signed-off-by: candiduslynx <candiduslynx@gmail.com>
esdrasbeleza pushed a commit to esdrasbeleza/databricks-sql-go that referenced this issue Apr 15, 2024
Closes databricks#206

Signed-off-by: candiduslynx <candiduslynx@gmail.com>
Signed-off-by: Esdras Beleza <esdras@esdrasbeleza.com>
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.

1 participant