module tarantool.schema
¶
Schema types definitions. For internal use only, there is no API to use pre-build schema objects.
- tarantool.schema.MAX_RECURSION_DEPTH = 32¶
Max possible known schema depth is 4 if foreign keys are used (since Tarantool 2.10), but there are no restrictions in protocol.
- class tarantool.schema.Schema(con)¶
Contains Tarantool server spaces schema.
- Parameters:
con¶ (
Connection
) – Related Tarantool server connection.
- fetch_index(space_object, index)¶
Fetch a single index space schema from the Tarantool server and build a schema object.
- Parameters:
space¶ (
SchemaSpace
) – Space schema.
- Return type:
- Raises:
SchemaError
,fetch_index_from()
exceptions
- fetch_index_all()¶
Fetch all spaces indexes schema from the Tarantool server and build corresponding schema objects.
- Raises:
fetch_index_from()
exceptions
- fetch_index_from(space, index)¶
Fetch space index schema from the Tarantool server.
- fetch_space(space)¶
Fetch a single space schema from the Tarantool server and build a schema object.
- Parameters:
- Return type:
- Raises:
SchemaError
,fetch_space_from()
exceptions
- fetch_space_all()¶
Fetch all spaces schema from the Tarantool server and build corresponding schema objects.
- Raises:
fetch_space_from()
exceptions
- fetch_space_from(space)¶
Fetch space schema from the Tarantool server.
- flush()¶
Clean existing schema data.
- get_field(space, field)¶
Get space field format info.
- Parameters:
- Returns:
Field format info.
- Return type:
- Raises:
SchemaError
,fetch_space()
exceptions
- get_index(space, index)¶
Get space index schema. If it exists in the local schema, return local data, otherwise fetch data from the Tarantool server.
- Parameters:
- Return type:
- Raises:
fetch_index()
exceptions
- get_space(space)¶
Get space schema. If it exists in the local schema, return local data, otherwise fetch data from the Tarantool server.
- Parameters:
- Return type:
- Raises:
fetch_space()
exceptions