space_object:alter() | Tarantool
Submodule box.space 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) – the space options such as field_count, user, format, name, and other. The full list of these options with descriptions parameters is provided 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'}]
...
Found what you were looking for?
Feedback