zeroshade commented on code in PR #3150: URL: https://github.com/apache/arrow-adbc/pull/3150#discussion_r2205839088
########## go/adbc/ext.go: ########## @@ -78,3 +81,55 @@ type OTelTracing interface { // Gets the initial span attributes for any newly started span. GetInitialSpanAttributes() []attribute.KeyValue } + +// IngestStreamOption bundles the most-common IngestStream settings. +// Any other ADBC options can go into Extra. +type IngestStreamOption struct { + TargetTable string // required + IngestMode string // required, e.g. adbc.OptionValueIngestModeCreateAppend, or OptionValueIngestModeReplace + Extra map[string]string // any other stmt.SetOption(...) args +} + +// IngestStream is a helper for executing a bulk ingestion. This is a wrapper around +// the five-step boilerplate of NewStatement, SetOption, Bind, +// Execute, and Close. +// +// This is not part of the ADBC API specification. +func IngestStream(ctx context.Context, cnxn Connection, reader array.RecordReader, opt IngestStreamOption) (int64, error) { + // 1) Create a new statement + stmt, err := cnxn.NewStatement() + if err != nil { + return -1, fmt.Errorf("IngestStream: NewStatement: %w", err) Review Comment: the convention for golang error strings is that they do not start with a capitalized letter. Perhaps something more like: ```go fmt.Errorf("error during ingestion: NewStatement: %w", err) ``` -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org