You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by li...@apache.org on 2023/01/18 17:25:21 UTC

[arrow-adbc] branch main updated: fix(go/adbc/driver/flightsql): cnxn should implement PostInitOptions (#357)

This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new 7cc718d  fix(go/adbc/driver/flightsql): cnxn should implement PostInitOptions (#357)
7cc718d is described below

commit 7cc718db8f4cdf4b90d8b57b659c3b1c1345eb2c
Author: Matt Topol <zo...@gmail.com>
AuthorDate: Wed Jan 18 12:25:15 2023 -0500

    fix(go/adbc/driver/flightsql): cnxn should implement PostInitOptions (#357)
---
 go/adbc/driver/flightsql/flightsql_adbc.go | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/go/adbc/driver/flightsql/flightsql_adbc.go b/go/adbc/driver/flightsql/flightsql_adbc.go
index 1fa6384..bfa8820 100644
--- a/go/adbc/driver/flightsql/flightsql_adbc.go
+++ b/go/adbc/driver/flightsql/flightsql_adbc.go
@@ -256,6 +256,21 @@ func doGet(ctx context.Context, cl *flightsql.Client, endpoint *flight.FlightEnd
 	return nil, err
 }
 
+func (c *cnxn) SetOption(key, value string) error {
+	switch key {
+	case adbc.OptionKeyAutoCommit:
+		return adbc.Error{
+			Msg:  "[Flight SQL] transactions not yet supported",
+			Code: adbc.StatusNotImplemented,
+		}
+	default:
+		return adbc.Error{
+			Msg:  "[Flight SQL] unknown connection option",
+			Code: adbc.StatusNotImplemented,
+		}
+	}
+}
+
 // GetInfo returns metadata about the database/driver.
 //
 // The result is an Arrow dataset with the following schema:
@@ -581,3 +596,7 @@ func (c *cnxn) ReadPartition(ctx context.Context, serializedPartition []byte) (r
 	}
 	return rdr, nil
 }
+
+var (
+	_ adbc.PostInitOptions = (*cnxn)(nil)
+)