Top.Mail.Ru
space_object:alter() | Tarantool
Submodule box.space / space_object:alter()
Tarantool
Check out the new release 2.8
Submodule box.space / space_object:alter()

space_object:alter()

space_object:alter()

object space_object
space_object:alter(options)

Since version 2.5.2. Alter an existing space. This method changes certain space parameters.

Parameters:
  • options (table) – field_count, user, format, temporary, is_sync, and name – the meaning of these parameters is the same as in box.schema.space.create()
Return:

nothing in case of success; an error when fails

Example:

tarantool> s = box.schema.create_space('tester')
---
...
tarantool> format = {{name = 'field1', type = 'unsigned'}}
---
...
tarantool> s:alter({name = 'tester1', format = format})
---
...
tarantool> s.name
---
- tester1
...
tarantool> s:format()
---
- [{'name': 'field1', 'type': 'unsigned'}]
...