Skip to content

Commit 59247a4

Browse files
committed
Read views - box.read_view.list (#3445)
1 parent d7dd6a2 commit 59247a4

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed

doc/reference/reference_lua/box.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ with ``box``, with no arguments. The ``box`` module contains:
2727
box_error
2828
box_index
2929
box_info
30+
box_read_view
3031
box_schema
3132
box_schema_sequence
3233
box_session
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
-------------------------------------------------------------------------------
2+
Submodule box.read_view
3+
-------------------------------------------------------------------------------
4+
5+
The box.read_view submodule contains functions related to read views.
6+
7+
.. container:: table
8+
9+
.. rst-class:: left-align-column-1
10+
.. rst-class:: left-align-column-2
11+
12+
.. list-table::
13+
:widths: 25 75
14+
:header-rows: 1
15+
16+
* - Name
17+
- Use
18+
19+
* - :doc:`./box_read_view/list`
20+
- Return an array of all active database read views.
21+
22+
23+
.. toctree::
24+
:hidden:
25+
26+
box_read_view/list
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
.. _reference_lua-box_read_view_list:
2+
3+
===============================================================================
4+
box.read_view.list()
5+
===============================================================================
6+
7+
.. function:: read_view.list()
8+
9+
Return an array of all active database read views.
10+
This array might include the following read view types:
11+
12+
* `read views <https://www.tarantool.io/en/enterprise_doc/read_views/>`_ created by application code (available in Tarantool Enterprise only)
13+
14+
* system read views (used, for example, to make a :ref:`checkpoint <book_cfg_checkpoint_daemon>`
15+
or join a new :ref:`replica <replication-architecture>`)
16+
17+
Read views created by application code also have the ``space`` field.
18+
The field lists all spaces available in a read view,
19+
and may be used like a read view object returned by ``box.read_view.open()``.
20+
21+
.. NOTE::
22+
23+
``read_view.list()`` also contains read views created using the
24+
`C API <https://www.tarantool.io/en/enterprise_doc/read_views/c_api/>`_ (``box_raw_read_view_new()``).
25+
Note that you cannot access database spaces included in such views from Lua.
26+
27+
28+
**Example:**
29+
30+
.. code-block:: tarantoolsession
31+
32+
tarantool> box.read_view.list()
33+
---
34+
- - timestamp: 1138.98706933
35+
signature: 47
36+
is_system: false
37+
status: open
38+
vclock: &0 {1: 47}
39+
name: read_view1
40+
id: 1
41+
- timestamp: 1172.202995842
42+
signature: 49
43+
is_system: false
44+
status: open
45+
vclock: &1 {1: 49}
46+
name: read_view2
47+
id: 2
48+
...

0 commit comments

Comments
 (0)