Read views: Lua API | Tarantool

Read views: Lua API

This topic describes the Lua API for working with read views.

box.read_view:open({opts})

Create a new read view.

Parameters:
  • opts (table) – (optional) configurations options for a read view. For example, the name option specifies a read view name. If name is not specified, a read view name is set to unknown.
Return:

a created read view object

Rtype:

read_view_object

Example:

tarantool> read_view1 = box.read_view.open({name = 'read_view1'})
object read_view_object

An object that represents a read view.

read_view_object:info()

Get information about a read view such as a name, status, or ID. All the available fields are listed below in the object options.

Return:information about a read view
Rtype:table
read_view_object:close()

Close a read view. After the read view is closed, its status is set to closed. On an attempt to use it, an error is raised.

read_view_object.status

A read view status. The possible values are open and closed.

Rtype:string
read_view_object.id

A unique numeric identifier of a read view.

Rtype:number
read_view_object.name

A read view name. You can specify a read view name in the box.read_view.open() arguments.

Rtype:string
read_view_object.is_system

Determine whether a read view is system. For example, system read views can be created to make a checkpoint or join a new replica.

Rtype:boolean
read_view_object.timestamp

The fiber.clock() value at the moment of opening a read view.

Rtype:number
read_view_object.vclock

The box.info.vclock value at the moment of opening a read view.

Rtype:table
read_view_object.signature

The box.info.signature value at the moment of opening a read view.

Rtype:number
read_view_object.space

Get access to database spaces included in a read view. You can use this field to query space data.

Rtype:space object
Found what you were looking for?
Feedback