Skip to content

Commit dc5db4b

Browse files
committed
add functions
1 parent 7bfab1f commit dc5db4b

File tree

4 files changed

+607
-8
lines changed

4 files changed

+607
-8
lines changed

doc/dev_guide/reference_capi/box.rst

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
206206
.. _box_box_sequence_current:
207207
208-
.. c:function:: int box_sequence_current(uint32_t seq_id, int64_t *result);
208+
.. c:function:: int box_sequence_current(uint32_t seq_id, int64_t *result)
209209
210210
Since version :doc:`2.4.1 </release/2.4.1>`.
211211
Return the last retrieved value of the specified sequence.
@@ -217,14 +217,47 @@
217217
:return: 0 on success and -1 otherwise. In case of an error user
218218
could get it via ``box_error_last()``.
219219
220-
.. _box_box_session_id:
220+
.. _box_box_schema_version:
221221
222-
.. c:function:: uint64_t box_session_id(void);
222+
.. c:function:: uint32_t box_schema_version(void)
223+
224+
Since version :doc:`2.11.0 </release/2.11.0>`.
225+
Return the database schema version.
226+
A schema version is a number that indicates whether the :ref:`database schema <index-box-data_schema_description>` is changed.
227+
For example, the ``schema_version`` value grows if a :ref:`space <index-box_space>` or :ref:`index <index-box_index>`
228+
is added or deleted, or a space, index, or field name is changed.
229+
230+
:return: the database schema version
231+
:rtype: number
232+
233+
See also :ref:`box.info.schema_version <box_info_schema_version>` and :ref:`IPROTO_SCHEMA_VERSION <internals-iproto-keys-schema_version>`.
234+
235+
.. _box_box_session_id:
236+
237+
.. c:function:: uint64_t box_session_id(void)
223238
224239
Since version :doc:`2.11.0 </release/2.11.0>`.
225240
Return the unique identifier (ID) for the current session.
226241
227242
:return: the unique identifier (ID) for the current session
228243
:return: 0 or -1 if there is no session
229244
230-
See also :ref:`box.session.id()<box_session-id>`
245+
See also :ref:`box.session.id() <box_session-id>`
246+
247+
.. _box_box_iproto_send:
248+
249+
.. c:function:: int box_iproto_send(uint64_t sid, char *header, char *header_end, char *body, char *body_end)
250+
251+
Since version :doc:`2.11.0 </release/2.11.0>`.
252+
Sends an :ref:`IPROTO <internals-iproto-format>` packet over the session's socket with the given MsgPack header
253+
and body. NB: делает yield.
254+
255+
:param uint32_t sid: space identifier
256+
:param char* header:
257+
:param char* header_end:
258+
:param char* body:
259+
:param char* body_end: encoded tuple in MsgPack Array format ([ field1, field2, ...])
260+
261+
:return: 0 on success or 1 if there is a failure
262+
263+
See also :ref:`box.session.id() <box_session-id>`

doc/reference/reference_lua/box_info/schema_version.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
.. _box_info_schema_version:
22

3-
================================================================================
43
box.info.schema_version
5-
================================================================================
4+
=======================
65

76
.. module:: box.info
87

0 commit comments

Comments
 (0)