@@ -355,7 +355,6 @@ func (c *Client) Prepare(ctx context.Context, mem memory.Allocator, query string
355355
356356 prep = & PreparedStatement {
357357 client : c ,
358- opts : opts ,
359358 handle : result .PreparedStatementHandle ,
360359 datasetSchema : dsSchema ,
361360 paramSchema : paramSchema ,
@@ -383,7 +382,6 @@ func (c *Client) Close() error { return c.Client.Close() }
383382// should be called when no longer needed.
384383type PreparedStatement struct {
385384 client * Client
386- opts []grpc.CallOption
387385 handle []byte
388386 datasetSchema * arrow.Schema
389387 paramSchema * arrow.Schema
@@ -397,7 +395,7 @@ type PreparedStatement struct {
397395// then the parameter bindings will be sent before execution.
398396//
399397// Will error if already closed.
400- func (p * PreparedStatement ) Execute (ctx context.Context ) (* flight.FlightInfo , error ) {
398+ func (p * PreparedStatement ) Execute (ctx context.Context , opts ... grpc. CallOption ) (* flight.FlightInfo , error ) {
401399 if p .closed {
402400 return nil , errors .New ("arrow/flightsql: prepared statement already closed" )
403401 }
@@ -410,7 +408,7 @@ func (p *PreparedStatement) Execute(ctx context.Context) (*flight.FlightInfo, er
410408 }
411409
412410 if p .hasBindParameters () {
413- pstream , err := p .client .Client .DoPut (ctx , p . opts ... )
411+ pstream , err := p .client .Client .DoPut (ctx , opts ... )
414412 if err != nil {
415413 return nil , err
416414 }
@@ -430,13 +428,13 @@ func (p *PreparedStatement) Execute(ctx context.Context) (*flight.FlightInfo, er
430428 }
431429 }
432430
433- return p .client .getFlightInfo (ctx , desc , p . opts ... )
431+ return p .client .getFlightInfo (ctx , desc , opts ... )
434432}
435433
436434// ExecuteUpdate executes the prepared statement update query on the server
437435// and returns the number of rows affected. If SetParameters was called,
438436// the parameter bindings will be sent with the request to execute.
439- func (p * PreparedStatement ) ExecuteUpdate (ctx context.Context ) (nrecords int64 , err error ) {
437+ func (p * PreparedStatement ) ExecuteUpdate (ctx context.Context , opts ... grpc. CallOption ) (nrecords int64 , err error ) {
440438 if p .closed {
441439 return 0 , errors .New ("arrow/flightsql: prepared statement already closed" )
442440 }
@@ -455,7 +453,7 @@ func (p *PreparedStatement) ExecuteUpdate(ctx context.Context) (nrecords int64,
455453 return
456454 }
457455
458- if pstream , err = p .client .Client .DoPut (ctx , p . opts ... ); err != nil {
456+ if pstream , err = p .client .Client .DoPut (ctx , opts ... ); err != nil {
459457 return
460458 }
461459 if p .hasBindParameters () {
@@ -529,7 +527,7 @@ func (p *PreparedStatement) ParameterSchema() *arrow.Schema { return p.paramSche
529527// statement from the server. It should otherwise be identical to DatasetSchema.
530528//
531529// Will error if already closed.
532- func (p * PreparedStatement ) GetSchema (ctx context.Context ) (* flight.SchemaResult , error ) {
530+ func (p * PreparedStatement ) GetSchema (ctx context.Context , opts ... grpc. CallOption ) (* flight.SchemaResult , error ) {
533531 if p .closed {
534532 return nil , errors .New ("arrow/flightsql: prepared statement already closed" )
535533 }
@@ -541,7 +539,7 @@ func (p *PreparedStatement) GetSchema(ctx context.Context) (*flight.SchemaResult
541539 return nil , err
542540 }
543541
544- return p .client .getSchema (ctx , desc , p . opts ... )
542+ return p .client .getSchema (ctx , desc , opts ... )
545543}
546544
547545func (p * PreparedStatement ) clearParameters () {
@@ -585,7 +583,7 @@ func (p *PreparedStatement) SetRecordReader(binding array.RecordReader) {
585583// Close calls release on any parameter binding record and sends
586584// a ClosePreparedStatement action to the server. After calling
587585// Close, the PreparedStatement should not be used again.
588- func (p * PreparedStatement ) Close (ctx context.Context ) error {
586+ func (p * PreparedStatement ) Close (ctx context.Context , opts ... grpc. CallOption ) error {
589587 if p .closed {
590588 return errors .New ("arrow/flightsql: already closed" )
591589 }
@@ -609,7 +607,7 @@ func (p *PreparedStatement) Close(ctx context.Context) error {
609607 }
610608
611609 action := & flight.Action {Type : actionType , Body : body }
612- _ , err = p .client .Client .DoAction (ctx , action , p . opts ... )
610+ _ , err = p .client .Client .DoAction (ctx , action , opts ... )
613611 if err != nil {
614612 return err
615613 }
0 commit comments