From 061579e716e4db5decd9d21c48a1ea2f786968a8 Mon Sep 17 00:00:00 2001 From: jnesss Date: Sat, 3 May 2025 14:09:25 -0700 Subject: [PATCH] Add time.Time support to Go driver parameter binding --- bindings/go/types.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bindings/go/types.go b/bindings/go/types.go index 608c41376..e8544eb37 100644 --- a/bindings/go/types.go +++ b/bindings/go/types.go @@ -4,6 +4,7 @@ import ( "database/sql/driver" "fmt" "runtime" + "time" "unsafe" ) @@ -244,6 +245,12 @@ func buildArgs(args []driver.Value) ([]limboValue, func(), error) { blob := makeBlob(val) pinner.Pin(blob) *(*uintptr)(unsafe.Pointer(&limboVal.Value)) = uintptr(unsafe.Pointer(blob)) + case time.Time: // Add this case + limboVal.Type = textVal + timeStr := val.Format(time.RFC3339) + cstr := CString(timeStr) + pinner.Pin(cstr) + *(*uintptr)(unsafe.Pointer(&limboVal.Value)) = uintptr(unsafe.Pointer(cstr)) default: return nil, pinner.Unpin, fmt.Errorf("unsupported type: %T", v) }