Skip to content

[2pt] Document return_raw net.box option #2506

@TarantoolBot

Description

@TarantoolBot

Document return_raw net.box option.

Product: Tarantool
Since: 2.10.0-beta2
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/
SME: @ locker
Peer reviewer: @

Details

If the return_raw flag is set, net.box will return response data
wrapped in a msgpack object (see msgpack.object()) instead of decoding
it to Lua. This can be useful when a response is supposed to be passed
through without decoding or with partial decoding - creating a msgpack
object can reduce pressure on the Lua garbage collector in this case.

Example:

local c = require('net.box').connect(uri)
local mp = c.eval('eval ...', {1, 2, 3}, {return_raw = true})
mp:decode() -- {1, 2, 3}

The option is ignored for methods that return nil (begin, commit,
rollback, upsert, prepare will return nil even if return_raw is
set) and for index.count (it returns a number). For execute, the
option is applied only to data (rows) while metadata is decoded
irrespective of the value of return_raw.
Requested by @locker in tarantool/tarantool@4423456.

Metadata

Metadata

Assignees

Labels

featureA new functionalityreference[location] Tarantool manual, Reference partserver[area] Task relates to Tarantool's server (core) functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions