You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/reference/tooling/tt_cli/export.rst
+91-8Lines changed: 91 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -11,12 +11,17 @@ Exporting data
11
11
12
12
.. code-block:: console
13
13
14
-
$ tt [crud] export URI SPACE:FILE ... [EXPORT_OPTION ...]
14
+
$ tt [crud|tdg2] export URI SPACE:FILE ... [EXPORT_OPTION ...]
15
15
16
-
``tt [crud] export`` exports a space's data to a file.
17
-
The ``crud`` command is optional and can be used to export a cluster's data by using the `CRUD <https://github.com/tarantool/crud>`_ module. Without ``crud``, data is exported using the :ref:`box.space <box_space>` API.
16
+
``tt [crud|tdg2] export`` exports a space's data to a file. Three export commands
17
+
cover the following cases:
18
18
19
-
``tt [crud] export`` takes the following arguments:
19
+
* ``tt export`` exports data from a replica set using the :ref:`box.space <box_space>` API.
20
+
* ``tt crud export`` exports data from a sharded cluster through a router using the `CRUD <https://github.com/tarantool/crud>`_ module.
21
+
* ``tt tdg2 export`` exports data from a `Tarantool Data Grid 2 <https://www.tarantool.io/ru/tdg/latest/>`_ cluster
22
+
through its `connector <https://www.tarantool.io/ru/tdg/latest/architecture/#connector>`_ using `TDG2 Repository API <https://www.tarantool.io/en/tdg/latest/reference/sandbox/repository-api/#repository-api>`_.
23
+
24
+
``tt [crud|tdg2] export`` takes the following arguments:
20
25
21
26
* ``URI``: The URI of a router instance if ``crud`` is used. Otherwise, it should specify the URI of a storage.
22
27
* ``FILE``: The name of a file for storing exported data.
@@ -26,6 +31,16 @@ The ``crud`` command is optional and can be used to export a cluster's data by u
26
31
27
32
:ref:`Read access <authentication-owners_privileges>` to the space is required to export its data.
28
33
34
+
.. _tt-export-output-format:
35
+
36
+
Output format
37
+
-------------
38
+
39
+
``tt export`` exports data in the following formats:
40
+
41
+
* ``tt export`` and ``tt crud export``: CSV
42
+
* ``tt tdg2 export``: JSON lines
43
+
29
44
.. _tt-export-limitations:
30
45
31
46
Limitations
@@ -66,7 +81,7 @@ If a tuple contains a ``null`` value, for example, ``[1, 477, 'Andrew', null, 38
66
81
Exporting headers
67
82
-----------------
68
83
69
-
To export data with a space's field names in the first row, use the ``--header`` option:
84
+
To export data with a space's field names in the first row of the CSV file, use the ``--header`` option:
70
85
71
86
.. code-block:: console
72
87
@@ -89,15 +104,69 @@ In this case, field values start from the second row, for example:
89
104
Exporting compound data
90
105
-----------------------
91
106
92
-
By default, ``tt`` exports empty values for fields containing compound data such as arrays or maps.
107
+
In the CSV format, ``tt`` exports empty values by default for fields containing compound data such as arrays or maps.
93
108
To export compound values in a specific format, use the ``--compound-value-format`` option.
94
-
For example, the command below exports compound values serialized in JSON:
109
+
For example, the command below exports compound values to CSV serialized in JSON:
Copy file name to clipboardExpand all lines: doc/reference/tooling/tt_cli/import.rst
+107-7Lines changed: 107 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -11,14 +11,19 @@ Importing data
11
11
12
12
.. code-block:: console
13
13
14
-
$ tt [crud] import URI FILE:SPACE [IMPORT_OPTION ...]
14
+
$ tt [crud|tdg2] import URI FILE:SPACE [IMPORT_OPTION ...]
15
15
# or
16
-
$ tt [crud] import URI :SPACE < FILE [IMPORT_OPTION ...]
16
+
$ tt [crud|tdg2] import URI :SPACE < FILE [IMPORT_OPTION ...]
17
17
18
-
``tt [crud] import`` imports data from a file to a space.
19
-
The ``crud`` command is optional and can be used to import data to a cluster by using the `CRUD <https://github.com/tarantool/crud>`_ module. Without ``crud``, data is imported using the :ref:`box.space <box_space>` API.
18
+
``tt [crud|tdg] import`` imports data from a file to a space. Three import commands
19
+
cover the following cases:
20
20
21
-
This command takes the following arguments:
21
+
* ``tt import`` imports data into a replica set through its master instance using the :ref:`box.space <box_space>` API.
22
+
* ``tt crud import`` imports data into a sharded cluster through a router using the `CRUD <https://github.com/tarantool/crud>`_ module.
23
+
* ``tt tdg2 import`` imports data into a `Tarantool Data Grid 2 <https://www.tarantool.io/ru/tdg/latest/>`_ cluster
24
+
through its router using the ``repository.put`` function of the `TDG2 Repository API <https://www.tarantool.io/en/tdg/latest/reference/sandbox/repository-api/#repository-api>`_.
25
+
26
+
``tt [crud|tdg2] import`` takes the following arguments:
22
27
23
28
* ``URI``: The URI of a router instance if ``crud`` is used. Otherwise, it should specify the URI of a storage.
24
29
* ``FILE``: The name of a file containing data to be imported.
@@ -28,6 +33,15 @@ This command takes the following arguments:
28
33
29
34
:ref:`Write access <authentication-owners_privileges>` to the space and `execute` access to `universe` are required to import data.
30
35
36
+
.. _tt-import-format:
37
+
38
+
Input file format
39
+
-----------------
40
+
41
+
``tt import`` imports data from the following formats:
42
+
43
+
* ``tt import`` and ``tt crud import``: CSV
44
+
* ``tt tdg2 import``: JSON lines
31
45
32
46
.. _tt-import-limitations:
33
47
@@ -134,14 +148,77 @@ To skip rows whose data cannot be parsed correctly, use the ``--on-error`` optio
0 commit comments