Module box
As well as executing Lua chunks or defining your own functions, you can exploit
Tarantool’s storage functionality with the box
module and its submodules.
Every submodule contains one or more Lua functions. A few submodules contain members as well as functions. The functions allow data definition (create alter drop), data manipulation (insert delete update upsert select replace), and introspection (inspecting contents of spaces, accessing server configuration).
To catch errors that functions in box
submodules may throw, use pcall.
The contents of the box
module can be inspected at runtime
with box
, with no arguments. The box
module contains:
- Submodule box.backup
- Submodule box.cfg
- Submodule box.ctl
- Submodule box.error
- Submodule box.index
- Examples for
box.index
- space_object:create_index()
- index_object.unique
- index_object.type
- index_object:parts
- index_object:pairs()
- index_object:select()
- index_object:get()
- index_object:min()
- index_object:max()
- index_object:random()
- index_object:count()
- index_object:update()
- index_object:delete()
- index_object:alter()
- index_object:drop()
- index_object:rename()
- index_object:bsize()
- index_object:stat()
- index_object:compact()
- index_object:tuple_pos()
- index_object extensions
- Examples for
- Submodule box.info
- Submodule box.iproto
- Submodule box.read_view
- Submodule box.schema
- box.schema.space.create()
- box.schema.upgrade()
- box.schema.downgrade()
- box.schema.downgrade_versions()
- box.schema.downgrade_issues()
- box.schema.user.create()
- box.schema.user.drop()
- box.schema.user.exists()
- box.schema.user.grant()
- box.schema.user.revoke()
- box.schema.user.password()
- box.schema.user.passwd()
- box.schema.user.info()
- box.schema.role.create()
- box.schema.role.drop()
- box.schema.role.exists()
- box.schema.role.grant()
- box.schema.role.revoke()
- box.schema.role.info()
- box.schema.func.create()
- box.schema.func.drop()
- box.schema.func.exists()
- box.schema.func.reload()
- Sequences
- Submodule box.session
- box.session.id()
- box.session.exists()
- box.session.peer()
- box.session.sync()
- box.session.user()
- box.session.type()
- box.session.su()
- box.session.uid()
- box.session.euid()
- box.session.storage
- box.session.on_connect()
- box.session.on_disconnect()
- box.session.on_auth()
- box.session.on_access_denied()
- box.session.push()
- Submodule box.slab
- Submodule box.space
- box.schema.space.create()
- space_object:alter()
- space_object:auto_increment()
- space_object:bsize()
- space_object:count()
- space_object:create_index()
- space_object:delete()
- space_object:drop()
- space_object:format()
- space_object:frommap()
- space_object:get()
- space_object:insert()
- space_object:len()
- space_object:on_replace()
- space_object:before_replace()
- space_object:pairs()
- space_object:put()
- space_object:rename()
- space_object:replace() / put()
- space_object:run_triggers()
- space_object:select()
- space_object:truncate()
- space_object:update()
- space_object:upsert()
- space_object extensions
- box.space.create_check_constraint()
- space_object:enabled
- space_object:field_count
- space_object.id
- space_object.index
- box.space._cluster
- box.space._func
- box.space._index
- box.space._vindex
- box.space._priv
- box.space._vpriv
- box.space._schema
- box.space._sequence
- box.space._sequence_data
- box.space._space
- box.space._vspace
- box.space._space_sequence
- box.space._vspace_sequence
- box.space._user
- box.space._vuser
- box.space._ck_constraint
- box.space._collation
- box.space._vcollation
- System space views
- box.space._session_settings
- Submodule box.stat
- Submodule box.tuple
- box.tuple.new()
- box.tuple.is()
- #tuple_object
- box.tuple.bsize()
- tuple_object[field-number]
- tuple_object[field-name]
- tuple_object[field-path]
- tuple_object:find(), tuple_object:findall()
- tuple_object:next()
- tuple_object:pairs(), tuple_object:ipairs()
- tuple_object:totable()
- tuple_object:tomap()
- tuple_object:transform()
- tuple_object:unpack()
- tuple_object:update()
- tuple_object:upsert()
- How to convert tuples to/from Lua tables
- Functions for transaction management
- Functions for SQL
- Event watchers
- Function box.once
- Function box.snapshot
- Constant box.NULL