Functional index function doesn't have to sandboxed anymore
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 15
- Forks
- 49
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 3
Description
Product: Tarantool
Since: 3.2
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_schema/func_create/#lua-data.function_options.is_sandboxed
https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_space/create_index/#creating-a-functional-index
SME: @ locker
Details
The user may now create a functional index using a function that doesn't
have the flag is_sandboxed. Note that a functional index function must
be deterministic and isn't allowed to yield or access the database so
the flag is_sandboxed is still recommended. However, there are cases
when the user might want to clear the flag. For example, it's the only
way to let a functional index function to call a deterministic function
defined in a module (e.g. json.encode).
Requested by @locker in https://github.com/tarantool/tarantool/commit/9e616ab6f2f94ba2bcad3044187c474a1c05a8c5.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the two linked root documents: box_schema/func_create and box_space/create_index. Review the is_sandboxed option and functional-index guidance, then update them to explain that sandboxing is not required, while the function must remain deterministic and must not yield or access the database. Done means the documentation also covers deterministic module functions such as json.encode.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100