Skip to content
Snippets Groups Projects
Commit 44234562 authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Kirill Yukhin
Browse files

net.box: add return_raw request option

Closes #4861

@TarantoolBot document
Title: Document return_raw net.box option

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:

```lua
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`.
parent 42acde67
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment