srimal-randoli opened a new issue, #3103:
URL: https://github.com/apache/arrow-adbc/issues/3103

   ### What would you like help with?
   
   I'm trying to access a FlightSQL server created using 
GizmoSQL(https://github.com/gizmodata/gizmosql) with a DuckDB Backend. And it 
seems that the go driver is unable to handle time.Time values properly when I 
try to pass them to a parameterized query.
   
   Here is my code.
   
   ```go
   package main
   
   import (
        "context"
        "database/sql"
        "fmt"
        "log"
        "testing"
        "time"
   
        _ "github.com/apache/arrow-adbc/go/adbc/sqldriver/flightsql"
   )
   
   var dsnTemplate = "uri=grpc://%s;username=%s;password=%s"
   
   const (
        FLIGHT_SQL_USER = "gizmosql_username"
        FLIGHT_SQL_PASS = "password123"
        FLIGHT_SQL_HOST = "localhost:31337"
   )
   
   // This example uses Go's native SQL driver
   func TestFlightSQL(t *testing.T) {
        dsn := fmt.Sprintf(dsnTemplate,
                FLIGHT_SQL_HOST,
                FLIGHT_SQL_USER,
                FLIGHT_SQL_PASS,
        )
   
        db, err := sql.Open("flightsql", dsn)
        if err != nil {
                log.Fatalf("opening a connection failed: %v", err)
        }
   
        defer db.Close()
   
        timestamp := time.Now()
   
        // Table schema
        // CREATE TABLE IF NOT EXISTS flight_test.events (id INTEGER, 
event_time TIMESTAMP)
        result, err := db.ExecContext(context.Background(), `INSERT INTO 
flight_test.events (id, event_time) VALUES (1, $1)`, timestamp)
        if err != nil {
                log.Fatal(err)
        }
   
        log.Print(result)
   }
   
   ```
   
   And this is the output
   
   ```text
   
   === RUN   TestFlightSQL
   2025/07/06 07:13:16 sql: converting argument $1 type: Invalid Argument: 
expected parameter of type timestamp[us]
   FAIL gitlab.com/srimaln91/flight-sql-client  0.046s
   ```
   
   Dependancies being used.
   
   ```text
        github.com/apache/arrow-adbc/go/adbc v1.6.0
        github.com/apache/arrow-go/v18 v18.2.0
   ```
   
   Any help would be much appreciated. Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to