Skip to content

Commit f3f8886

Browse files
vr009oleg-jukovec
authored andcommitted
code health: add ExecuteTyped/ExecuteAsync to the common interface
Added ExecuteTyped/ExecuteAsync implementation to multi package. CHANGELOG.md updated. Follows up #62
1 parent ac4f611 commit f3f8886

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
3030
### Fixed
3131

3232
- Build with OpenSSL < 1.1.1 (#194)
33+
- Add `ExecuteAsync` and `ExecuteTyped` to common connector interface (#62)
3334

3435
## [1.6.0] - 2022-06-01
3536

connector.go

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ type Connector interface {
3030
Call16Typed(functionName string, args interface{}, result interface{}) (err error)
3131
Call17Typed(functionName string, args interface{}, result interface{}) (err error)
3232
EvalTyped(expr string, args interface{}, result interface{}) (err error)
33+
ExecuteTyped(expr string, args interface{}, result interface{}) (SQLInfo, []ColumnMetaData, error)
3334

3435
SelectAsync(space, index interface{}, offset, limit, iterator uint32, key interface{}) *Future
3536
InsertAsync(space interface{}, tuple interface{}) *Future
@@ -41,6 +42,7 @@ type Connector interface {
4142
Call16Async(functionName string, args interface{}) *Future
4243
Call17Async(functionName string, args interface{}) *Future
4344
EvalAsync(expr string, args interface{}) *Future
45+
ExecuteAsync(expr string, args interface{}) *Future
4446

4547
Do(req Request) (fut *Future)
4648
}

multi/multi.go

+10
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,11 @@ func (connMulti *ConnectionMulti) EvalTyped(expr string, args interface{}, resul
419419
return connMulti.getCurrentConnection().EvalTyped(expr, args, result)
420420
}
421421

422+
// ExecuteTyped passes sql expression to Tarantool for execution.
423+
func (connMulti *ConnectionMulti) ExecuteTyped(expr string, args interface{}, result interface{}) (tarantool.SQLInfo, []tarantool.ColumnMetaData, error) {
424+
return connMulti.getCurrentConnection().ExecuteTyped(expr, args, result)
425+
}
426+
422427
// SelectAsync sends select request to Tarantool and returns Future.
423428
func (connMulti *ConnectionMulti) SelectAsync(space, index interface{}, offset, limit, iterator uint32, key interface{}) *tarantool.Future {
424429
return connMulti.getCurrentConnection().SelectAsync(space, index, offset, limit, iterator, key)
@@ -482,6 +487,11 @@ func (connMulti *ConnectionMulti) EvalAsync(expr string, args interface{}) *tara
482487
return connMulti.getCurrentConnection().EvalAsync(expr, args)
483488
}
484489

490+
// ExecuteAsync passes sql expression to Tarantool for execution.
491+
func (connMulti *ConnectionMulti) ExecuteAsync(expr string, args interface{}) *tarantool.Future {
492+
return connMulti.getCurrentConnection().ExecuteAsync(expr, args)
493+
}
494+
485495
// Do sends the request and returns a future.
486496
func (connMulti *ConnectionMulti) Do(req tarantool.Request) *tarantool.Future {
487497
return connMulti.getCurrentConnection().Do(req)

0 commit comments

Comments
 (0)