Skip to content

Commit 69b9552

Browse files
committed
Add draft
1 parent 618b71b commit 69b9552

File tree

1 file changed

+45
-6
lines changed

1 file changed

+45
-6
lines changed

doc/dev_guide/internals/msgpack_extensions.rst

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ MessagePack extensions
77
----------------------------
88

99
Tarantool uses predefined MessagePack extension types to represent some
10-
of the special values. Extension types include ``MP_DECIMAL``, ``MP_UUID``
11-
and ``MP_ERROR``. These types require special attention from the connector
12-
developers, as they must be treated separately from the default MessagePack
13-
types, and correctly mapped to programming language types.
10+
of the special values. Extension types include ``MP_DECIMAL``, ``MP_UUID``,
11+
``MP_ERROR``, ``MP_DATETIME``, and ``MP_INTERVAL``.
12+
These types require special attention from the connector developers,
13+
as they must be treated separately from the default MessagePack types,
14+
and correctly mapped to programming language types.
1415

1516
*******************************
1617
The DECIMAL type
@@ -19,7 +20,7 @@ The DECIMAL type
1920
The MessagePack EXT type ``MP_EXT`` together with the extension type
2021
``MP_DECIMAL`` is a header for values of the DECIMAL type.
2122

22-
MP_DECIMAL is 1.
23+
``MP_DECIMAL`` is 1.
2324

2425
`MessagePack spec <https://github.com/msgpack/msgpack/blob/master/spec.md>`_
2526
defines two kinds of types:
@@ -107,7 +108,7 @@ The UUID type
107108
The MessagePack EXT type ``MP_EXT`` together with the extension type
108109
``MP_UUID`` for values of the UUID type. Since version :doc:`2.4.1 </release/2.4.1>`.
109110

110-
MP_UUID is 2.
111+
``MP_UUID`` is 2.
111112

112113
The `MessagePack spec <https://github.com/msgpack/msgpack/blob/master/spec.md>`_
113114
defines ``d8`` to mean fixext with size 16, and a uuid's size is always 16.
@@ -233,3 +234,41 @@ the server response will look like this:
233234
00 MP_UINT = error number
234235
05 MP_ERROR_ERRCODE
235236
0a MP_UINT = eror code ER_SPACE_EXISTS
237+
238+
239+
.. _msgpack_ext-datetime:
240+
241+
**********************************
242+
The DATETIME type
243+
**********************************
244+
245+
Since version :doc:`2.10.0 </release/2.10.0>`.
246+
``MP_DATETIME`` is 4.
247+
248+
The datetime MessagePack representation looks like this:
249+
250+
.. code-block:: none
251+
252+
+--------+-------------------+------------+===============+
253+
| MP_EXT | length (optional) | MP_DECIMAL | PackedDecimal |
254+
+--------+-------------------+------------+===============+
255+
256+
.. _msgpack_ext-interval:
257+
258+
**********************************
259+
The INTERVAL type
260+
**********************************
261+
262+
The MessagePack EXT type ``MP_EXT`` together with the extension type
263+
``MP_INTERVAL`` is a header for values of the INTERVAL type.
264+
Since version :doc:`2.10.0 </release/2.10.0>`.
265+
266+
``MP_INTERVAL`` is 6.
267+
268+
The interval MessagePack representation looks like this:
269+
270+
.. code-block:: none
271+
272+
+--------+-------------------+------------+===============+
273+
| MP_EXT | length (optional) | MP_INTERVAL | PackedDecimal |
274+
+--------+-------------------+------------+===============+

0 commit comments

Comments
 (0)