forked from fl00r/go-tarantool-1.6
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add public API with a request object for Select/Update/Upsert
This patch provides request types for part of space operations: Select, Update and Upstream. It allows to create requests step by step. The main idea here is too provide more extensible approach to create requests. Part of #126
- Loading branch information
1 parent
cb9f156
commit 3ce324b
Showing
11 changed files
with
995 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,23 @@ | ||
package tarantool | ||
|
||
func (schema *Schema) ResolveSpaceIndex(s interface{}, i interface{}) (spaceNo, indexNo uint32, err error) { | ||
return schema.resolveSpaceIndex(s, i) | ||
import ( | ||
"gopkg.in/vmihailenco/msgpack.v2" | ||
) | ||
|
||
// RefImplSelectBody is reference implementation for filling of a select | ||
// request's body. | ||
func RefImplSelectBody(enc *msgpack.Encoder, space, index, offset, limit, iterator uint32, key interface{}) error { | ||
return fillSelect(enc, space, index, offset, limit, iterator, key) | ||
} | ||
|
||
// RefImplUpdateBody is reference implementation for filling of an update | ||
// request's body. | ||
func RefImplUpdateBody(enc *msgpack.Encoder, space, index uint32, key, ops interface{}) error { | ||
return fillUpdate(enc, space, index, key, ops) | ||
} | ||
|
||
// RefImplUpsertBody is reference implementation for filling of an upsert | ||
// request's body. | ||
func RefImplUpsertBody(enc *msgpack.Encoder, space uint32, tuple, ops interface{}) error { | ||
return fillUpsert(enc, space, tuple, ops) | ||
} |
Oops, something went wrong.