Documentation
¶
Overview ¶
Package crud with support of API of Tarantool's CRUD module.
Supported CRUD methods:
insert
insert_object
insert_many
insert_object_many
get
update
delete
replace
replace_object
replace_many
replace_object_many
upsert
upsert_object
upsert_many
upsert_object_many
select
min
max
truncate
len
storage_info
count
stats
unflatten_rows
Since: 1.11.0.
Index ¶
- type BaseOpts
- type BoolResult
- type BorderOpts
- type Condition
- type CountOpts
- type CountRequest
- type CountResult
- type DeleteOpts
- type DeleteRequest
- type Error
- type ErrorMany
- type FieldFormat
- type GetOpts
- type GetRequest
- type InsertManyOpts
- type InsertManyRequest
- func (req InsertManyRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
- func (req InsertManyRequest) Context(ctx context.Context) InsertManyRequest
- func (req InsertManyRequest) Opts(opts InsertManyOpts) InsertManyRequest
- func (req InsertManyRequest) Tuples(tuples []Tuple) InsertManyRequest
- type InsertObjectManyOpts
- type InsertObjectManyRequest
- func (req InsertObjectManyRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
- func (req InsertObjectManyRequest) Context(ctx context.Context) InsertObjectManyRequest
- func (req InsertObjectManyRequest) Objects(objects []Object) InsertObjectManyRequest
- func (req InsertObjectManyRequest) Opts(opts InsertObjectManyOpts) InsertObjectManyRequest
- type InsertObjectOpts
- type InsertObjectRequest
- func (req InsertObjectRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
- func (req InsertObjectRequest) Context(ctx context.Context) InsertObjectRequest
- func (req InsertObjectRequest) Object(object Object) InsertObjectRequest
- func (req InsertObjectRequest) Opts(opts InsertObjectOpts) InsertObjectRequest
- type InsertOpts
- type InsertRequest
- type LenOpts
- type LenRequest
- type LenResult
- type MapObject
- type MaxOpts
- type MaxRequest
- type MinOpts
- type MinRequest
- type NumberResult
- type Object
- type ObjectOperationsData
- type Operation
- type OperationManyOpts
- type OperationObjectManyOpts
- type Operator
- type OptBool
- type OptInt
- type OptString
- type OptTuple
- type OptUint
- type ReplaceManyOpts
- type ReplaceManyRequest
- func (req ReplaceManyRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
- func (req ReplaceManyRequest) Context(ctx context.Context) ReplaceManyRequest
- func (req ReplaceManyRequest) Opts(opts ReplaceManyOpts) ReplaceManyRequest
- func (req ReplaceManyRequest) Tuples(tuples []Tuple) ReplaceManyRequest
- type ReplaceObjectManyOpts
- type ReplaceObjectManyRequest
- func (req ReplaceObjectManyRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
- func (req ReplaceObjectManyRequest) Context(ctx context.Context) ReplaceObjectManyRequest
- func (req ReplaceObjectManyRequest) Objects(objects []Object) ReplaceObjectManyRequest
- func (req ReplaceObjectManyRequest) Opts(opts ReplaceObjectManyOpts) ReplaceObjectManyRequest
- type ReplaceObjectOpts
- type ReplaceObjectRequest
- func (req ReplaceObjectRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
- func (req ReplaceObjectRequest) Context(ctx context.Context) ReplaceObjectRequest
- func (req ReplaceObjectRequest) Object(object Object) ReplaceObjectRequest
- func (req ReplaceObjectRequest) Opts(opts ReplaceObjectOpts) ReplaceObjectRequest
- type ReplaceOpts
- type ReplaceRequest
- type Result
- type SelectOpts
- type SelectRequest
- type SimpleOperationObjectOpts
- type SimpleOperationOpts
- type StatsRequest
- func (req StatsRequest) Async() bool
- func (req StatsRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
- func (req StatsRequest) Code() int32
- func (req StatsRequest) Context(ctx context.Context) StatsRequest
- func (req StatsRequest) Ctx() context.Context
- func (req StatsRequest) Space(space string) StatsRequest
- type StatusTable
- type StorageInfoOpts
- type StorageInfoRequest
- func (req StorageInfoRequest) Async() bool
- func (req StorageInfoRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
- func (req StorageInfoRequest) Code() int32
- func (req StorageInfoRequest) Context(ctx context.Context) StorageInfoRequest
- func (req StorageInfoRequest) Ctx() context.Context
- func (req StorageInfoRequest) Opts(opts StorageInfoOpts) StorageInfoRequest
- type StorageInfoResult
- type TruncateOpts
- type TruncateRequest
- type TruncateResult
- type Tuple
- type TupleOperationsData
- type UpdateOpts
- type UpdateRequest
- func (req UpdateRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
- func (req UpdateRequest) Context(ctx context.Context) UpdateRequest
- func (req UpdateRequest) Key(key Tuple) UpdateRequest
- func (req UpdateRequest) Operations(operations []Operation) UpdateRequest
- func (req UpdateRequest) Opts(opts UpdateOpts) UpdateRequest
- type UpsertManyOpts
- type UpsertManyRequest
- func (req UpsertManyRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
- func (req UpsertManyRequest) Context(ctx context.Context) UpsertManyRequest
- func (req UpsertManyRequest) Opts(opts UpsertManyOpts) UpsertManyRequest
- func (req UpsertManyRequest) TuplesOperationsData(tuplesOperationData []TupleOperationsData) UpsertManyRequest
- type UpsertObjectManyOpts
- type UpsertObjectManyRequest
- func (req UpsertObjectManyRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
- func (req UpsertObjectManyRequest) Context(ctx context.Context) UpsertObjectManyRequest
- func (req UpsertObjectManyRequest) ObjectsOperationsData(objectsOperationData []ObjectOperationsData) UpsertObjectManyRequest
- func (req UpsertObjectManyRequest) Opts(opts UpsertObjectManyOpts) UpsertObjectManyRequest
- type UpsertObjectOpts
- type UpsertObjectRequest
- func (req UpsertObjectRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
- func (req UpsertObjectRequest) Context(ctx context.Context) UpsertObjectRequest
- func (req UpsertObjectRequest) Object(object Object) UpsertObjectRequest
- func (req UpsertObjectRequest) Operations(operations []Operation) UpsertObjectRequest
- func (req UpsertObjectRequest) Opts(opts UpsertObjectOpts) UpsertObjectRequest
- type UpsertOpts
- type UpsertRequest
- func (req UpsertRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
- func (req UpsertRequest) Context(ctx context.Context) UpsertRequest
- func (req UpsertRequest) Operations(operations []Operation) UpsertRequest
- func (req UpsertRequest) Opts(opts UpsertOpts) UpsertRequest
- func (req UpsertRequest) Tuple(tuple Tuple) UpsertRequest
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseOpts ¶
type BaseOpts struct { // Timeout is a `vshard.call` timeout and vshard // master discovery timeout (in seconds). Timeout OptUint // VshardRouter is cartridge vshard group name or // vshard router instance. VshardRouter OptString }
BaseOpts describes base options for CRUD operations.
func (BaseOpts) EncodeMsgpack ¶
EncodeMsgpack provides custom msgpack encoder.
type BoolResult ¶
type BoolResult struct {
Value bool
}
BoolResult describes CRUD result as an object containing bool.
func (*BoolResult) DecodeMsgpack ¶
func (r *BoolResult) DecodeMsgpack(d *decoder) error
DecodeMsgpack provides custom msgpack decoder.
type BorderOpts ¶
type BorderOpts struct { // Timeout is a `vshard.call` timeout and vshard // master discovery timeout (in seconds). Timeout OptUint // VshardRouter is cartridge vshard group name or // vshard router instance. VshardRouter OptString // Fields is field names for getting only a subset of fields. Fields OptTuple }
BorderOpts describes options for `crud.min` and `crud.max`.
func (BorderOpts) EncodeMsgpack ¶
func (opts BorderOpts) EncodeMsgpack(enc *encoder) error
EncodeMsgpack provides custom msgpack encoder.
type Condition ¶
type Condition struct { Operator Operator Field string // Field name or index name. Value interface{} // contains filtered or unexported fields }
Condition describes CRUD condition as a table {operator, field-identifier, value}.
type CountOpts ¶
type CountOpts struct { // Timeout is a `vshard.call` timeout and vshard // master discovery timeout (in seconds). Timeout OptUint // VshardRouter is cartridge vshard group name or // vshard router instance. VshardRouter OptString // Mode is a parameter with `write`/`read` possible values, // if `write` is specified then operation is performed on master. Mode OptString // PreferReplica is a parameter to specify preferred target // as one of the replicas. PreferReplica OptBool // Balance is a parameter to use replica according to vshard // load balancing policy. Balance OptBool // YieldEvery describes number of tuples processed to yield after. YieldEvery OptUint // BucketId is a bucket ID. BucketId OptUint // ForceMapCall describes the map call is performed without any // optimizations even if full primary key equal condition is specified. ForceMapCall OptBool // Fullscan describes if a critical log entry will be skipped on // potentially long count. Fullscan OptBool }
CountOpts describes options for `crud.count` method.
func (CountOpts) EncodeMsgpack ¶
EncodeMsgpack provides custom msgpack encoder.
type CountRequest ¶
type CountRequest struct {
// contains filtered or unexported fields
}
CountRequest helps you to create request object to call `crud.count` for execution by a Connection.
func MakeCountRequest ¶
func MakeCountRequest(space string) CountRequest
MakeCountRequest returns a new empty CountRequest.
func (CountRequest) Body ¶
func (req CountRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (CountRequest) Conditions ¶
func (req CountRequest) Conditions(conditions []Condition) CountRequest
Conditions sets the conditions for the CountRequest request. Note: default value is nil.
func (CountRequest) Context ¶
func (req CountRequest) Context(ctx context.Context) CountRequest
Context sets a passed context to CRUD request.
func (CountRequest) Opts ¶
func (req CountRequest) Opts(opts CountOpts) CountRequest
Opts sets the options for the CountRequest request. Note: default value is nil.
type CountResult ¶
type CountResult = NumberResult
CountResult describes result for `crud.count` method.
type DeleteOpts ¶
type DeleteOpts = SimpleOperationOpts
DeleteOpts describes options for `crud.delete` method.
type DeleteRequest ¶
type DeleteRequest struct {
// contains filtered or unexported fields
}
DeleteRequest helps you to create request object to call `crud.delete` for execution by a Connection.
func MakeDeleteRequest ¶
func MakeDeleteRequest(space string) DeleteRequest
MakeDeleteRequest returns a new empty DeleteRequest.
func (DeleteRequest) Body ¶
func (req DeleteRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (DeleteRequest) Context ¶
func (req DeleteRequest) Context(ctx context.Context) DeleteRequest
Context sets a passed context to CRUD request.
func (DeleteRequest) Key ¶
func (req DeleteRequest) Key(key Tuple) DeleteRequest
Key sets the key for the DeleteRequest request. Note: default value is nil.
func (DeleteRequest) Opts ¶
func (req DeleteRequest) Opts(opts DeleteOpts) DeleteRequest
Opts sets the options for the DeleteRequest request. Note: default value is nil.
type Error ¶
type Error struct { // ClassName is an error class that implies its source (for example, "CountError"). ClassName string // Err is the text of reason. Err string // File is a source code file where the error was caught. File string // Line is a number of line in the source code file where the error was caught. Line uint64 // Stack is an information about the call stack when an error // occurs in a string format. Stack string // Str is the text of reason with error class. Str string }
Error describes CRUD error object.
func (*Error) DecodeMsgpack ¶
DecodeMsgpack provides custom msgpack decoder.
type ErrorMany ¶
type ErrorMany struct {
Errors []Error
}
ErrorMany describes CRUD error object for `_many` methods.
func (*ErrorMany) DecodeMsgpack ¶
DecodeMsgpack provides custom msgpack decoder.
type FieldFormat ¶
FieldFormat contains field definition: {name='...',type='...'[,is_nullable=...]}.
func (*FieldFormat) DecodeMsgpack ¶
func (format *FieldFormat) DecodeMsgpack(d *decoder) error
DecodeMsgpack provides custom msgpack decoder.
type GetOpts ¶
type GetOpts struct { // Timeout is a `vshard.call` timeout and vshard // master discovery timeout (in seconds). Timeout OptUint // VshardRouter is cartridge vshard group name or // vshard router instance. VshardRouter OptString // Fields is field names for getting only a subset of fields. Fields OptTuple // BucketId is a bucket ID. BucketId OptUint // Mode is a parameter with `write`/`read` possible values, // if `write` is specified then operation is performed on master. Mode OptString // PreferReplica is a parameter to specify preferred target // as one of the replicas. PreferReplica OptBool // Balance is a parameter to use replica according to vshard // load balancing policy. Balance OptBool }
GetOpts describes options for `crud.get` method.
func (GetOpts) EncodeMsgpack ¶
EncodeMsgpack provides custom msgpack encoder.
type GetRequest ¶
type GetRequest struct {
// contains filtered or unexported fields
}
GetRequest helps you to create request object to call `crud.get` for execution by a Connection.
func MakeGetRequest ¶
func MakeGetRequest(space string) GetRequest
MakeGetRequest returns a new empty GetRequest.
func (GetRequest) Body ¶
func (req GetRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (GetRequest) Context ¶
func (req GetRequest) Context(ctx context.Context) GetRequest
Context sets a passed context to CRUD request.
func (GetRequest) Key ¶
func (req GetRequest) Key(key Tuple) GetRequest
Key sets the key for the GetRequest request. Note: default value is nil.
func (GetRequest) Opts ¶
func (req GetRequest) Opts(opts GetOpts) GetRequest
Opts sets the options for the GetRequest request. Note: default value is nil.
type InsertManyOpts ¶
type InsertManyOpts = OperationManyOpts
InsertManyOpts describes options for `crud.insert_many` method.
type InsertManyRequest ¶
type InsertManyRequest struct {
// contains filtered or unexported fields
}
InsertManyRequest helps you to create request object to call `crud.insert_many` for execution by a Connection.
func MakeInsertManyRequest ¶
func MakeInsertManyRequest(space string) InsertManyRequest
MakeInsertManyRequest returns a new empty InsertManyRequest.
func (InsertManyRequest) Body ¶
func (req InsertManyRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (InsertManyRequest) Context ¶
func (req InsertManyRequest) Context(ctx context.Context) InsertManyRequest
Context sets a passed context to CRUD request.
func (InsertManyRequest) Opts ¶
func (req InsertManyRequest) Opts(opts InsertManyOpts) InsertManyRequest
Opts sets the options for the InsertManyRequest request. Note: default value is nil.
func (InsertManyRequest) Tuples ¶
func (req InsertManyRequest) Tuples(tuples []Tuple) InsertManyRequest
Tuples sets the tuples for the InsertManyRequest request. Note: default value is nil.
type InsertObjectManyOpts ¶
type InsertObjectManyOpts = OperationObjectManyOpts
InsertObjectManyOpts describes options for `crud.insert_object_many` method.
type InsertObjectManyRequest ¶
type InsertObjectManyRequest struct {
// contains filtered or unexported fields
}
InsertObjectManyRequest helps you to create request object to call `crud.insert_object_many` for execution by a Connection.
func MakeInsertObjectManyRequest ¶
func MakeInsertObjectManyRequest(space string) InsertObjectManyRequest
MakeInsertObjectManyRequest returns a new empty InsertObjectManyRequest.
func (InsertObjectManyRequest) Body ¶
func (req InsertObjectManyRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (InsertObjectManyRequest) Context ¶
func (req InsertObjectManyRequest) Context(ctx context.Context) InsertObjectManyRequest
Context sets a passed context to CRUD request.
func (InsertObjectManyRequest) Objects ¶
func (req InsertObjectManyRequest) Objects(objects []Object) InsertObjectManyRequest
Objects sets the objects for the InsertObjectManyRequest request. Note: default value is nil.
func (InsertObjectManyRequest) Opts ¶
func (req InsertObjectManyRequest) Opts(opts InsertObjectManyOpts) InsertObjectManyRequest
Opts sets the options for the InsertObjectManyRequest request. Note: default value is nil.
type InsertObjectOpts ¶
type InsertObjectOpts = SimpleOperationObjectOpts
InsertObjectOpts describes options for `crud.insert_object` method.
type InsertObjectRequest ¶
type InsertObjectRequest struct {
// contains filtered or unexported fields
}
InsertObjectRequest helps you to create request object to call `crud.insert_object` for execution by a Connection.
func MakeInsertObjectRequest ¶
func MakeInsertObjectRequest(space string) InsertObjectRequest
MakeInsertObjectRequest returns a new empty InsertObjectRequest.
func (InsertObjectRequest) Body ¶
func (req InsertObjectRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (InsertObjectRequest) Context ¶
func (req InsertObjectRequest) Context(ctx context.Context) InsertObjectRequest
Context sets a passed context to CRUD request.
func (InsertObjectRequest) Object ¶
func (req InsertObjectRequest) Object(object Object) InsertObjectRequest
Object sets the tuple for the InsertObjectRequest request. Note: default value is nil.
func (InsertObjectRequest) Opts ¶
func (req InsertObjectRequest) Opts(opts InsertObjectOpts) InsertObjectRequest
Opts sets the options for the InsertObjectRequest request. Note: default value is nil.
type InsertOpts ¶
type InsertOpts = SimpleOperationOpts
InsertOpts describes options for `crud.insert` method.
type InsertRequest ¶
type InsertRequest struct {
// contains filtered or unexported fields
}
InsertRequest helps you to create request object to call `crud.insert` for execution by a Connection.
func MakeInsertRequest ¶
func MakeInsertRequest(space string) InsertRequest
MakeInsertRequest returns a new empty InsertRequest.
func (InsertRequest) Body ¶
func (req InsertRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (InsertRequest) Context ¶
func (req InsertRequest) Context(ctx context.Context) InsertRequest
Context sets a passed context to CRUD request.
func (InsertRequest) Opts ¶
func (req InsertRequest) Opts(opts InsertOpts) InsertRequest
Opts sets the options for the insert request. Note: default value is nil.
func (InsertRequest) Tuple ¶
func (req InsertRequest) Tuple(tuple Tuple) InsertRequest
Tuple sets the tuple for the InsertRequest request. Note: default value is nil.
type LenRequest ¶
type LenRequest struct {
// contains filtered or unexported fields
}
LenRequest helps you to create request object to call `crud.len` for execution by a Connection.
func MakeLenRequest ¶
func MakeLenRequest(space string) LenRequest
MakeLenRequest returns a new empty LenRequest.
func (LenRequest) Body ¶
func (req LenRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (LenRequest) Context ¶
func (req LenRequest) Context(ctx context.Context) LenRequest
Context sets a passed context to CRUD request.
func (LenRequest) Opts ¶
func (req LenRequest) Opts(opts LenOpts) LenRequest
Opts sets the options for the LenRequest request. Note: default value is nil.
type MapObject ¶
type MapObject map[string]interface{}
MapObject is a type to describe object as a map.
func UnflattenRows ¶
UnflattenRows can be used to convert received tuples to objects.
func (MapObject) EncodeMsgpack ¶
func (o MapObject) EncodeMsgpack(enc *encoder)
type MaxRequest ¶
type MaxRequest struct {
// contains filtered or unexported fields
}
MaxRequest helps you to create request object to call `crud.max` for execution by a Connection.
func MakeMaxRequest ¶
func MakeMaxRequest(space string) MaxRequest
MakeMaxRequest returns a new empty MaxRequest.
func (MaxRequest) Body ¶
func (req MaxRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (MaxRequest) Context ¶
func (req MaxRequest) Context(ctx context.Context) MaxRequest
Context sets a passed context to CRUD request.
func (MaxRequest) Index ¶
func (req MaxRequest) Index(index interface{}) MaxRequest
Index sets the index name/id for the MaxRequest request. Note: default value is nil.
func (MaxRequest) Opts ¶
func (req MaxRequest) Opts(opts MaxOpts) MaxRequest
Opts sets the options for the MaxRequest request. Note: default value is nil.
type MinRequest ¶
type MinRequest struct {
// contains filtered or unexported fields
}
MinRequest helps you to create request object to call `crud.min` for execution by a Connection.
func MakeMinRequest ¶
func MakeMinRequest(space string) MinRequest
MakeMinRequest returns a new empty MinRequest.
func (MinRequest) Body ¶
func (req MinRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (MinRequest) Context ¶
func (req MinRequest) Context(ctx context.Context) MinRequest
Context sets a passed context to CRUD request.
func (MinRequest) Index ¶
func (req MinRequest) Index(index interface{}) MinRequest
Index sets the index name/id for the MinRequest request. Note: default value is nil.
func (MinRequest) Opts ¶
func (req MinRequest) Opts(opts MinOpts) MinRequest
Opts sets the options for the MinRequest request. Note: default value is nil.
type NumberResult ¶
type NumberResult struct {
Value uint64
}
NumberResult describes CRUD result as an object containing number.
func (*NumberResult) DecodeMsgpack ¶
func (r *NumberResult) DecodeMsgpack(d *decoder) error
DecodeMsgpack provides custom msgpack decoder.
type Object ¶
type Object interface {
EncodeMsgpack(enc *encoder)
}
Object is an interface to describe object for CRUD methods.
type ObjectOperationsData ¶
type ObjectOperationsData struct { Object Object Operations []Operation // contains filtered or unexported fields }
ObjectOperationsData contains object with operations to be applied to object.
type Operation ¶
type Operation struct { Operator Operator Field interface{} // Number or string. Value interface{} // contains filtered or unexported fields }
Operation describes CRUD operation as a table {operator, field_identifier, value}.
type OperationManyOpts ¶
type OperationManyOpts struct { // Timeout is a `vshard.call` timeout and vshard // master discovery timeout (in seconds). Timeout OptUint // VshardRouter is cartridge vshard group name or // vshard router instance. VshardRouter OptString // Fields is field names for getting only a subset of fields. Fields OptTuple // StopOnError is a parameter to stop on a first error and report // error regarding the failed operation and error about what tuples // were not performed. StopOnError OptBool // RollbackOnError is a parameter because of what any failed operation // will lead to rollback on a storage, where the operation is failed. RollbackOnError OptBool }
OperationManyOpts describes options for CRUD operations with many tuples.
func (OperationManyOpts) EncodeMsgpack ¶
func (opts OperationManyOpts) EncodeMsgpack(enc *encoder) error
EncodeMsgpack provides custom msgpack encoder.
type OperationObjectManyOpts ¶
type OperationObjectManyOpts struct { // Timeout is a `vshard.call` timeout and vshard // master discovery timeout (in seconds). Timeout OptUint // VshardRouter is cartridge vshard group name or // vshard router instance. VshardRouter OptString // Fields is field names for getting only a subset of fields. Fields OptTuple // StopOnError is a parameter to stop on a first error and report // error regarding the failed operation and error about what tuples // were not performed. StopOnError OptBool // RollbackOnError is a parameter because of what any failed operation // will lead to rollback on a storage, where the operation is failed. RollbackOnError OptBool // SkipNullabilityCheckOnFlatten is a parameter to allow // setting null values to non-nullable fields. SkipNullabilityCheckOnFlatten OptBool }
OperationObjectManyOpts describes options for CRUD operations with many objects.
func (OperationObjectManyOpts) EncodeMsgpack ¶
func (opts OperationObjectManyOpts) EncodeMsgpack(enc *encoder) error
EncodeMsgpack provides custom msgpack encoder.
type Operator ¶
type Operator string
Operator is a type to describe operator of operation.
const ( // Eq - comparison operator for "equal". Eq Operator = "=" // Lt - comparison operator for "less than". Lt Operator = "<" // Le - comparison operator for "less than or equal". Le Operator = "<=" // Gt - comparison operator for "greater than". Gt Operator = ">" // Ge - comparison operator for "greater than or equal". Ge Operator = ">=" )
const ( // Add - operator for addition. Add Operator = "+" // Sub - operator for subtraction. Sub Operator = "-" // And - operator for bitwise AND. And Operator = "&" // Or - operator for bitwise OR. Or Operator = "|" // Xor - operator for bitwise XOR. Xor Operator = "^" // Splice - operator for string splice. Splice Operator = ":" // Insert - operator for insertion of a new field. Insert Operator = "!" // Delete - operator for deletion. Delete Operator = "#" // Assign - operator for assignment. Assign Operator = "=" )
type OptBool ¶
type OptBool struct {
// contains filtered or unexported fields
}
OptBool is an optional bool.
func MakeOptBool ¶
MakeOptBool creates an optional bool from value.
type OptInt ¶
type OptInt struct {
// contains filtered or unexported fields
}
OptInt is an optional int.
type OptString ¶
type OptString struct {
// contains filtered or unexported fields
}
OptString is an optional string.
func MakeOptString ¶
MakeOptString creates an optional string from value.
type OptTuple ¶
type OptTuple struct {
// contains filtered or unexported fields
}
OptTuple is an optional tuple.
func MakeOptTuple ¶
func MakeOptTuple(tuple interface{}) OptTuple
MakeOptTuple creates an optional tuple from tuple.
type OptUint ¶
type OptUint struct {
// contains filtered or unexported fields
}
OptUint is an optional uint.
func MakeOptUint ¶
MakeOptUint creates an optional uint from value.
type ReplaceManyOpts ¶
type ReplaceManyOpts = OperationManyOpts
ReplaceManyOpts describes options for `crud.replace_many` method.
type ReplaceManyRequest ¶
type ReplaceManyRequest struct {
// contains filtered or unexported fields
}
ReplaceManyRequest helps you to create request object to call `crud.replace_many` for execution by a Connection.
func MakeReplaceManyRequest ¶
func MakeReplaceManyRequest(space string) ReplaceManyRequest
MakeReplaceManyRequest returns a new empty ReplaceManyRequest.
func (ReplaceManyRequest) Body ¶
func (req ReplaceManyRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (ReplaceManyRequest) Context ¶
func (req ReplaceManyRequest) Context(ctx context.Context) ReplaceManyRequest
Context sets a passed context to CRUD request.
func (ReplaceManyRequest) Opts ¶
func (req ReplaceManyRequest) Opts(opts ReplaceManyOpts) ReplaceManyRequest
Opts sets the options for the ReplaceManyRequest request. Note: default value is nil.
func (ReplaceManyRequest) Tuples ¶
func (req ReplaceManyRequest) Tuples(tuples []Tuple) ReplaceManyRequest
Tuples sets the tuples for the ReplaceManyRequest request. Note: default value is nil.
type ReplaceObjectManyOpts ¶
type ReplaceObjectManyOpts = OperationObjectManyOpts
ReplaceObjectManyOpts describes options for `crud.replace_object_many` method.
type ReplaceObjectManyRequest ¶
type ReplaceObjectManyRequest struct {
// contains filtered or unexported fields
}
ReplaceObjectManyRequest helps you to create request object to call `crud.replace_object_many` for execution by a Connection.
func MakeReplaceObjectManyRequest ¶
func MakeReplaceObjectManyRequest(space string) ReplaceObjectManyRequest
MakeReplaceObjectManyRequest returns a new empty ReplaceObjectManyRequest.
func (ReplaceObjectManyRequest) Body ¶
func (req ReplaceObjectManyRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (ReplaceObjectManyRequest) Context ¶
func (req ReplaceObjectManyRequest) Context(ctx context.Context) ReplaceObjectManyRequest
Context sets a passed context to CRUD request.
func (ReplaceObjectManyRequest) Objects ¶
func (req ReplaceObjectManyRequest) Objects(objects []Object) ReplaceObjectManyRequest
Objects sets the tuple for the ReplaceObjectManyRequest request. Note: default value is nil.
func (ReplaceObjectManyRequest) Opts ¶
func (req ReplaceObjectManyRequest) Opts(opts ReplaceObjectManyOpts) ReplaceObjectManyRequest
Opts sets the options for the ReplaceObjectManyRequest request. Note: default value is nil.
type ReplaceObjectOpts ¶
type ReplaceObjectOpts = SimpleOperationObjectOpts
ReplaceObjectOpts describes options for `crud.replace_object` method.
type ReplaceObjectRequest ¶
type ReplaceObjectRequest struct {
// contains filtered or unexported fields
}
ReplaceObjectRequest helps you to create request object to call `crud.replace_object` for execution by a Connection.
func MakeReplaceObjectRequest ¶
func MakeReplaceObjectRequest(space string) ReplaceObjectRequest
MakeReplaceObjectRequest returns a new empty ReplaceObjectRequest.
func (ReplaceObjectRequest) Body ¶
func (req ReplaceObjectRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (ReplaceObjectRequest) Context ¶
func (req ReplaceObjectRequest) Context(ctx context.Context) ReplaceObjectRequest
Context sets a passed context to CRUD request.
func (ReplaceObjectRequest) Object ¶
func (req ReplaceObjectRequest) Object(object Object) ReplaceObjectRequest
Object sets the tuple for the ReplaceObjectRequest request. Note: default value is nil.
func (ReplaceObjectRequest) Opts ¶
func (req ReplaceObjectRequest) Opts(opts ReplaceObjectOpts) ReplaceObjectRequest
Opts sets the options for the ReplaceObjectRequest request. Note: default value is nil.
type ReplaceOpts ¶
type ReplaceOpts = SimpleOperationOpts
ReplaceOpts describes options for `crud.replace` method.
type ReplaceRequest ¶
type ReplaceRequest struct {
// contains filtered or unexported fields
}
ReplaceRequest helps you to create request object to call `crud.replace` for execution by a Connection.
func MakeReplaceRequest ¶
func MakeReplaceRequest(space string) ReplaceRequest
MakeReplaceRequest returns a new empty ReplaceRequest.
func (ReplaceRequest) Body ¶
func (req ReplaceRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (ReplaceRequest) Context ¶
func (req ReplaceRequest) Context(ctx context.Context) ReplaceRequest
Context sets a passed context to CRUD request.
func (ReplaceRequest) Opts ¶
func (req ReplaceRequest) Opts(opts ReplaceOpts) ReplaceRequest
Opts sets the options for the ReplaceRequest request. Note: default value is nil.
func (ReplaceRequest) Tuple ¶
func (req ReplaceRequest) Tuple(tuple Tuple) ReplaceRequest
Tuple sets the tuple for the ReplaceRequest request. Note: default value is nil.
type Result ¶
type Result struct { Metadata []FieldFormat Rows interface{} // contains filtered or unexported fields }
Result describes CRUD result as an object containing metadata and rows.
Example (Error) ¶
ExampleResult_error demonstrates how to use a helper type Result to handle a crud error.
conn := exampleConnect() req := crud.MakeReplaceRequest("not_exist"). Tuple([]interface{}{uint(2010), nil, "bla"}) ret := crud.Result{} if err := conn.Do(req).GetTyped(&ret); err != nil { crudErr := err.(crud.Error) fmt.Printf("Failed to execute request: %s", crudErr) } else { fmt.Println(ret.Metadata) fmt.Println(ret.Rows) }
Output: Failed to execute request: ReplaceError: Space "not_exist" doesn't exist
Example (ErrorMany) ¶
ExampleResult_errorMany demonstrates how to use a helper type Result to handle a crud error for a *ManyRequest.
conn := exampleConnect() initReq := crud.MakeReplaceRequest("not_exist"). Tuple([]interface{}{uint(2010), nil, "bla"}) if _, err := conn.Do(initReq).Get(); err != nil { fmt.Printf("Failed to initialize the example: %s\n", err) } req := crud.MakeInsertManyRequest(exampleSpace). Tuples([]crud.Tuple{ []interface{}{uint(2010), nil, "bla"}, []interface{}{uint(2010), nil, "bla"}, }) ret := crud.Result{} if err := conn.Do(req).GetTyped(&ret); err != nil { crudErr := err.(crud.ErrorMany) // We need to trim the error message to make the example repeatable. errmsg := crudErr.Error()[:10] fmt.Printf("Failed to execute request: %s", errmsg) } else { fmt.Println(ret.Metadata) fmt.Println(ret.Rows) }
Output: Failed to execute request: CallError:
Example (Many) ¶
ExampleResult_many demonstrates that there is no difference in a response from *ManyRequest.
conn := exampleConnect() req := crud.MakeReplaceManyRequest(exampleSpace). Tuples([]crud.Tuple{ []interface{}{uint(2010), nil, "bla"}, []interface{}{uint(2011), nil, "bla"}, }) ret := crud.Result{} if err := conn.Do(req).GetTyped(&ret); err != nil { fmt.Printf("Failed to execute request: %s", err) return } fmt.Println(ret.Metadata) fmt.Println(ret.Rows)
Output: [{id unsigned false} {bucket_id unsigned true} {name string false}] [[2010 45 bla] [2011 4 bla]]
Example (RowsCustomType) ¶
ExampleResult_rowsCustomType demonstrates how to use a helper type Result to decode a crud response. In this example, rows are decoded as a custom type.
conn := exampleConnect() req := crud.MakeReplaceRequest(exampleSpace). Tuple([]interface{}{uint(2010), nil, "bla"}) type Tuple struct { _msgpack struct{} `msgpack:",asArray"` //nolint: structcheck,unused Id uint64 BucketId uint64 Name string } ret := crud.MakeResult(reflect.TypeOf(Tuple{})) if err := conn.Do(req).GetTyped(&ret); err != nil { fmt.Printf("Failed to execute request: %s", err) return } fmt.Println(ret.Metadata) rows := ret.Rows.([]Tuple) fmt.Println(rows)
Output: [{id unsigned false} {bucket_id unsigned true} {name string false}] [{{} 2010 45 bla}]
Example (RowsInterface) ¶
ExampleResult_rowsInterface demonstrates how to use a helper type Result to decode a crud response. In this example, rows are decoded as an interface{} type.
conn := exampleConnect() req := crud.MakeReplaceRequest(exampleSpace). Tuple([]interface{}{uint(2010), nil, "bla"}) ret := crud.Result{} if err := conn.Do(req).GetTyped(&ret); err != nil { fmt.Printf("Failed to execute request: %s", err) return } fmt.Println(ret.Metadata) fmt.Println(ret.Rows)
Output: [{id unsigned false} {bucket_id unsigned true} {name string false}] [[2010 45 bla]]
func MakeResult ¶
MakeResult create a Result object with a custom row type for decoding.
func (*Result) DecodeMsgpack ¶
DecodeMsgpack provides custom msgpack decoder.
type SelectOpts ¶
type SelectOpts struct { // Timeout is a `vshard.call` timeout and vshard // master discovery timeout (in seconds). Timeout OptUint // VshardRouter is cartridge vshard group name or // vshard router instance. VshardRouter OptString // Fields is field names for getting only a subset of fields. Fields OptTuple // BucketId is a bucket ID. BucketId OptUint // Mode is a parameter with `write`/`read` possible values, // if `write` is specified then operation is performed on master. Mode OptString // PreferReplica is a parameter to specify preferred target // as one of the replicas. PreferReplica OptBool // Balance is a parameter to use replica according to vshard // load balancing policy. Balance OptBool // First describes the maximum count of the objects to return. First OptInt // After is a tuple after which objects should be selected. After OptTuple // BatchSize is a number of tuples to process per one request to storage. BatchSize OptUint // ForceMapCall describes the map call is performed without any // optimizations even if full primary key equal condition is specified. ForceMapCall OptBool // Fullscan describes if a critical log entry will be skipped on // potentially long select. Fullscan OptBool }
SelectOpts describes options for `crud.select` method.
func (SelectOpts) EncodeMsgpack ¶
func (opts SelectOpts) EncodeMsgpack(enc *encoder) error
EncodeMsgpack provides custom msgpack encoder.
type SelectRequest ¶
type SelectRequest struct {
// contains filtered or unexported fields
}
SelectRequest helps you to create request object to call `crud.select` for execution by a Connection.
func MakeSelectRequest ¶
func MakeSelectRequest(space string) SelectRequest
MakeSelectRequest returns a new empty SelectRequest.
func (SelectRequest) Body ¶
func (req SelectRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (SelectRequest) Conditions ¶
func (req SelectRequest) Conditions(conditions []Condition) SelectRequest
Conditions sets the conditions for the SelectRequest request. Note: default value is nil.
func (SelectRequest) Context ¶
func (req SelectRequest) Context(ctx context.Context) SelectRequest
Context sets a passed context to CRUD request.
func (SelectRequest) Opts ¶
func (req SelectRequest) Opts(opts SelectOpts) SelectRequest
Opts sets the options for the SelectRequest request. Note: default value is nil.
type SimpleOperationObjectOpts ¶
type SimpleOperationObjectOpts struct { // Timeout is a `vshard.call` timeout and vshard // master discovery timeout (in seconds). Timeout OptUint // VshardRouter is cartridge vshard group name or // vshard router instance. VshardRouter OptString // Fields is field names for getting only a subset of fields. Fields OptTuple // BucketId is a bucket ID. BucketId OptUint // SkipNullabilityCheckOnFlatten is a parameter to allow // setting null values to non-nullable fields. SkipNullabilityCheckOnFlatten OptBool }
SimpleOperationObjectOpts describes options for simple CRUD operations with objects.
func (SimpleOperationObjectOpts) EncodeMsgpack ¶
func (opts SimpleOperationObjectOpts) EncodeMsgpack(enc *encoder) error
EncodeMsgpack provides custom msgpack encoder.
type SimpleOperationOpts ¶
type SimpleOperationOpts struct { // Timeout is a `vshard.call` timeout and vshard // master discovery timeout (in seconds). Timeout OptUint // VshardRouter is cartridge vshard group name or // vshard router instance. VshardRouter OptString // Fields is field names for getting only a subset of fields. Fields OptTuple // BucketId is a bucket ID. BucketId OptUint }
SimpleOperationOpts describes options for simple CRUD operations.
func (SimpleOperationOpts) EncodeMsgpack ¶
func (opts SimpleOperationOpts) EncodeMsgpack(enc *encoder) error
EncodeMsgpack provides custom msgpack encoder.
type StatsRequest ¶
type StatsRequest struct {
// contains filtered or unexported fields
}
StatsRequest helps you to create request object to call `crud.stats` for execution by a Connection.
func MakeStatsRequest ¶
func MakeStatsRequest() StatsRequest
MakeStatsRequest returns a new empty StatsRequest.
func (StatsRequest) Async ¶
func (req StatsRequest) Async() bool
Async returns is CRUD request expects a response.
func (StatsRequest) Body ¶
func (req StatsRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (StatsRequest) Code ¶
func (req StatsRequest) Code() int32
Code returns IPROTO code for CRUD request.
func (StatsRequest) Context ¶
func (req StatsRequest) Context(ctx context.Context) StatsRequest
Context sets a passed context to CRUD request.
func (StatsRequest) Space ¶
func (req StatsRequest) Space(space string) StatsRequest
Space sets the space name for the StatsRequest request. Note: default value is nil.
type StatusTable ¶
StatusTable describes information for instance.
func (*StatusTable) DecodeMsgpack ¶
func (statusTable *StatusTable) DecodeMsgpack(d *decoder) error
DecodeMsgpack provides custom msgpack decoder.
type StorageInfoOpts ¶
type StorageInfoOpts = BaseOpts
StorageInfoOpts describes options for `crud.storage_info` method.
type StorageInfoRequest ¶
type StorageInfoRequest struct {
// contains filtered or unexported fields
}
StorageInfoRequest helps you to create request object to call `crud.storage_info` for execution by a Connection.
func MakeStorageInfoRequest ¶
func MakeStorageInfoRequest() StorageInfoRequest
MakeStorageInfoRequest returns a new empty StorageInfoRequest.
func (StorageInfoRequest) Async ¶
func (req StorageInfoRequest) Async() bool
Async returns is CRUD request expects a response.
func (StorageInfoRequest) Body ¶
func (req StorageInfoRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (StorageInfoRequest) Code ¶
func (req StorageInfoRequest) Code() int32
Code returns IPROTO code for CRUD request.
func (StorageInfoRequest) Context ¶
func (req StorageInfoRequest) Context(ctx context.Context) StorageInfoRequest
Context sets a passed context to CRUD request.
func (StorageInfoRequest) Opts ¶
func (req StorageInfoRequest) Opts(opts StorageInfoOpts) StorageInfoRequest
Opts sets the options for the torageInfoRequest request. Note: default value is nil.
type StorageInfoResult ¶
type StorageInfoResult struct {
Info map[string]StatusTable
}
StorageInfoResult describes result for `crud.storage_info` method.
func (*StorageInfoResult) DecodeMsgpack ¶
func (r *StorageInfoResult) DecodeMsgpack(d *decoder) error
DecodeMsgpack provides custom msgpack decoder.
type TruncateOpts ¶
type TruncateOpts = BaseOpts
TruncateOpts describes options for `crud.truncate` method.
type TruncateRequest ¶
type TruncateRequest struct {
// contains filtered or unexported fields
}
TruncateRequest helps you to create request object to call `crud.truncate` for execution by a Connection.
func MakeTruncateRequest ¶
func MakeTruncateRequest(space string) TruncateRequest
MakeTruncateRequest returns a new empty TruncateRequest.
func (TruncateRequest) Body ¶
func (req TruncateRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (TruncateRequest) Context ¶
func (req TruncateRequest) Context(ctx context.Context) TruncateRequest
Context sets a passed context to CRUD request.
func (TruncateRequest) Opts ¶
func (req TruncateRequest) Opts(opts TruncateOpts) TruncateRequest
Opts sets the options for the TruncateRequest request. Note: default value is nil.
type TruncateResult ¶
type TruncateResult = BoolResult
TruncateResult describes result for `crud.truncate` method.
type Tuple ¶
type Tuple = interface{}
Tuple is a type to describe tuple for CRUD methods. It can be any type that msgpask can encode.
type TupleOperationsData ¶
type TupleOperationsData struct { Tuple Tuple Operations []Operation // contains filtered or unexported fields }
TupleOperationsData contains tuple with operations to be applied to tuple.
type UpdateOpts ¶
type UpdateOpts = SimpleOperationOpts
UpdateOpts describes options for `crud.update` method.
type UpdateRequest ¶
type UpdateRequest struct {
// contains filtered or unexported fields
}
UpdateRequest helps you to create request object to call `crud.update` for execution by a Connection.
func MakeUpdateRequest ¶
func MakeUpdateRequest(space string) UpdateRequest
MakeUpdateRequest returns a new empty UpdateRequest.
func (UpdateRequest) Body ¶
func (req UpdateRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (UpdateRequest) Context ¶
func (req UpdateRequest) Context(ctx context.Context) UpdateRequest
Context sets a passed context to CRUD request.
func (UpdateRequest) Key ¶
func (req UpdateRequest) Key(key Tuple) UpdateRequest
Key sets the key for the UpdateRequest request. Note: default value is nil.
func (UpdateRequest) Operations ¶
func (req UpdateRequest) Operations(operations []Operation) UpdateRequest
Operations sets the operations for UpdateRequest request. Note: default value is nil.
func (UpdateRequest) Opts ¶
func (req UpdateRequest) Opts(opts UpdateOpts) UpdateRequest
Opts sets the options for the UpdateRequest request. Note: default value is nil.
type UpsertManyOpts ¶
type UpsertManyOpts = OperationManyOpts
UpsertManyOpts describes options for `crud.upsert_many` method.
type UpsertManyRequest ¶
type UpsertManyRequest struct {
// contains filtered or unexported fields
}
UpsertManyRequest helps you to create request object to call `crud.upsert_many` for execution by a Connection.
func MakeUpsertManyRequest ¶
func MakeUpsertManyRequest(space string) UpsertManyRequest
MakeUpsertManyRequest returns a new empty UpsertManyRequest.
func (UpsertManyRequest) Body ¶
func (req UpsertManyRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (UpsertManyRequest) Context ¶
func (req UpsertManyRequest) Context(ctx context.Context) UpsertManyRequest
Context sets a passed context to CRUD request.
func (UpsertManyRequest) Opts ¶
func (req UpsertManyRequest) Opts(opts UpsertManyOpts) UpsertManyRequest
Opts sets the options for the UpsertManyRequest request. Note: default value is nil.
func (UpsertManyRequest) TuplesOperationsData ¶
func (req UpsertManyRequest) TuplesOperationsData(tuplesOperationData []TupleOperationsData) UpsertManyRequest
TuplesOperationsData sets tuples and operations for the UpsertManyRequest request. Note: default value is nil.
type UpsertObjectManyOpts ¶
type UpsertObjectManyOpts = OperationManyOpts
UpsertObjectManyOpts describes options for `crud.upsert_object_many` method.
type UpsertObjectManyRequest ¶
type UpsertObjectManyRequest struct {
// contains filtered or unexported fields
}
UpsertObjectManyRequest helps you to create request object to call `crud.upsert_object_many` for execution by a Connection.
func MakeUpsertObjectManyRequest ¶
func MakeUpsertObjectManyRequest(space string) UpsertObjectManyRequest
MakeUpsertObjectManyRequest returns a new empty UpsertObjectManyRequest.
func (UpsertObjectManyRequest) Body ¶
func (req UpsertObjectManyRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (UpsertObjectManyRequest) Context ¶
func (req UpsertObjectManyRequest) Context(ctx context.Context) UpsertObjectManyRequest
Context sets a passed context to CRUD request.
func (UpsertObjectManyRequest) ObjectsOperationsData ¶
func (req UpsertObjectManyRequest) ObjectsOperationsData( objectsOperationData []ObjectOperationsData) UpsertObjectManyRequest
ObjectOperationsData sets objects and operations for the UpsertObjectManyRequest request. Note: default value is nil.
func (UpsertObjectManyRequest) Opts ¶
func (req UpsertObjectManyRequest) Opts(opts UpsertObjectManyOpts) UpsertObjectManyRequest
Opts sets the options for the UpsertObjectManyRequest request. Note: default value is nil.
type UpsertObjectOpts ¶
type UpsertObjectOpts = SimpleOperationOpts
UpsertObjectOpts describes options for `crud.upsert_object` method.
type UpsertObjectRequest ¶
type UpsertObjectRequest struct {
// contains filtered or unexported fields
}
UpsertObjectRequest helps you to create request object to call `crud.upsert_object` for execution by a Connection.
func MakeUpsertObjectRequest ¶
func MakeUpsertObjectRequest(space string) UpsertObjectRequest
MakeUpsertObjectRequest returns a new empty UpsertObjectRequest.
func (UpsertObjectRequest) Body ¶
func (req UpsertObjectRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (UpsertObjectRequest) Context ¶
func (req UpsertObjectRequest) Context(ctx context.Context) UpsertObjectRequest
Context sets a passed context to CRUD request.
func (UpsertObjectRequest) Object ¶
func (req UpsertObjectRequest) Object(object Object) UpsertObjectRequest
Object sets the tuple for the UpsertObjectRequest request. Note: default value is nil.
func (UpsertObjectRequest) Operations ¶
func (req UpsertObjectRequest) Operations(operations []Operation) UpsertObjectRequest
Operations sets the operations for the UpsertObjectRequest request. Note: default value is nil.
func (UpsertObjectRequest) Opts ¶
func (req UpsertObjectRequest) Opts(opts UpsertObjectOpts) UpsertObjectRequest
Opts sets the options for the UpsertObjectRequest request. Note: default value is nil.
type UpsertOpts ¶
type UpsertOpts = SimpleOperationOpts
UpsertOpts describes options for `crud.upsert` method.
type UpsertRequest ¶
type UpsertRequest struct {
// contains filtered or unexported fields
}
UpsertRequest helps you to create request object to call `crud.upsert` for execution by a Connection.
func MakeUpsertRequest ¶
func MakeUpsertRequest(space string) UpsertRequest
MakeUpsertRequest returns a new empty UpsertRequest.
func (UpsertRequest) Body ¶
func (req UpsertRequest) Body(res tarantool.SchemaResolver, enc *encoder) error
Body fills an encoder with the call request body.
func (UpsertRequest) Context ¶
func (req UpsertRequest) Context(ctx context.Context) UpsertRequest
Context sets a passed context to CRUD request.
func (UpsertRequest) Operations ¶
func (req UpsertRequest) Operations(operations []Operation) UpsertRequest
Operations sets the operations for the UpsertRequest request. Note: default value is nil.
func (UpsertRequest) Opts ¶
func (req UpsertRequest) Opts(opts UpsertOpts) UpsertRequest
Opts sets the options for the UpsertRequest request. Note: default value is nil.
func (UpsertRequest) Tuple ¶
func (req UpsertRequest) Tuple(tuple Tuple) UpsertRequest
Tuple sets the tuple for the UpsertRequest request. Note: default value is nil.