Skip to content

Commit f4fdb75

Browse files
authored
Correct description of applying data schema on the Code tab in the schema.yml file (#3062)
Fixes #3053
1 parent de58780 commit f4fdb75

File tree

2 files changed

+57
-57
lines changed

2 files changed

+57
-57
lines changed

doc/book/box/data_model.rst

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ Full information is in section
451451
- :ref:`decimal <index-box_decimal>`
452452
- TREE or HASH
453453
* - ``'string'`` (may also be called ``'str'``)
454-
- :ref:`string <index-box_string>`
454+
- :ref:`string <index-box_string>`
455455
- TREE, BITSET, or HASH
456456
* - ``'varbinary'``
457457
- :ref:`varbinary <index-box_bin>`
@@ -467,22 +467,22 @@ Full information is in section
467467
- :ref:`RTREE <box_index-rtree>`
468468
* - ``'scalar'``
469469
- may include :ref:`nil <index-box_nil>`,
470-
:ref:`boolean <index-box_boolean>`,
471-
:ref:`integer <index-box_integer>`,
472-
:ref:`unsigned <index-box_unsigned>`,
473-
:ref:`number <index-box_number>`,
474-
:ref:`decimal <index-box_decimal>`,
475-
:ref:`string <index-box_string>`,
476-
:ref:`varbinary <index-box_bin>`,
470+
:ref:`boolean <index-box_boolean>`,
471+
:ref:`integer <index-box_integer>`,
472+
:ref:`unsigned <index-box_unsigned>`,
473+
:ref:`number <index-box_number>`,
474+
:ref:`decimal <index-box_decimal>`,
475+
:ref:`string <index-box_string>`,
476+
:ref:`varbinary <index-box_bin>`,
477477
or :ref:`uuid <index-box_uuid>` values |
478478
|br|
479-
When a scalar field contains values of
480-
different underlying types, the key order
481-
is: nils, then booleans, then numbers,
482-
then strings, then varbinaries, then
483-
uuids.
479+
When a scalar field contains values of
480+
different underlying types, the key order
481+
is: nils, then booleans, then numbers,
482+
then strings, then varbinaries, then
483+
uuids.
484484
- TREE or HASH
485-
485+
486486
.. _index-collation:
487487

488488
Collations
@@ -1111,40 +1111,40 @@ resource usage of each function.
11111111
* - Complexity factor
11121112
- Effect
11131113
* - Index size
1114-
- The number of index keys is the same as the number
1115-
of tuples in the data set. For a TREE index, if
1116-
there are more keys, then the lookup time will be
1117-
greater, although, of course, the effect is not
1118-
linear. For a HASH index, if there are more keys,
1119-
then there is more RAM used, but the number of
1120-
low-level steps tends to remain constant.
1114+
- The number of index keys is the same as the number
1115+
of tuples in the data set. For a TREE index, if
1116+
there are more keys, then the lookup time will be
1117+
greater, although, of course, the effect is not
1118+
linear. For a HASH index, if there are more keys,
1119+
then there is more RAM used, but the number of
1120+
low-level steps tends to remain constant.
11211121
* - Index type
1122-
- Typically, a HASH index is faster than a TREE index
1123-
if the number of tuples in the space is greater
1124-
than one.
1122+
- Typically, a HASH index is faster than a TREE index
1123+
if the number of tuples in the space is greater
1124+
than one.
11251125
* - Number of indexes accessed
1126-
- Ordinarily, only one index is accessed to retrieve
1127-
one tuple. But to update the tuple, there must be N
1128-
accesses if the space has N different indexes.
1129-
|br|
1130-
Note regarding storage engine: Vinyl optimizes away such
1131-
accesses if secondary index fields are unchanged by
1132-
the update. So, this complexity factor applies only to
1133-
memtx, since it always makes a full-tuple copy on every
1126+
- Ordinarily, only one index is accessed to retrieve
1127+
one tuple. But to update the tuple, there must be N
1128+
accesses if the space has N different indexes.
1129+
|br|
1130+
Note regarding storage engine: Vinyl optimizes away such
1131+
accesses if secondary index fields are unchanged by
1132+
the update. So, this complexity factor applies only to
1133+
memtx, since it always makes a full-tuple copy on every
11341134
update.
11351135
* - Number of tuples accessed
1136-
- A few requests, for example, SELECT, can retrieve
1137-
multiple tuples. This factor is usually less
1138-
important than the others.
1136+
- A few requests, for example, SELECT, can retrieve
1137+
multiple tuples. This factor is usually less
1138+
important than the others.
11391139
* - WAL settings
1140-
- The important setting for the write-ahead log is
1141-
:ref:`wal_mode <cfg_binary_logging_snapshots-wal_mode>`.
1142-
If the setting causes no writing or
1143-
delayed writing, this factor is unimportant. If the
1144-
setting causes every data-change request to wait
1145-
for writing to finish on a slow device, this factor
1146-
is more important than all the others.
1147-
1140+
- The important setting for the write-ahead log is
1141+
:ref:`wal_mode <cfg_binary_logging_snapshots-wal_mode>`.
1142+
If the setting causes no writing or
1143+
delayed writing, this factor is unimportant. If the
1144+
setting causes every data-change request to wait
1145+
for writing to finish on a slow device, this factor
1146+
is more important than all the others.
1147+
11481148

11491149
Data schema description
11501150
-----------------------
@@ -1225,13 +1225,13 @@ The schema would look something like this:
12251225
12261226
This alternative is simpler to use, and you do not have to dive deep into Lua.
12271227

1228-
``DDL`` is a built-in
1228+
``DDL`` is a built-in
12291229
:doc:`Cartridge </book/cartridge/index>` module.
12301230
Cartridge is a cluster solution for Tarantool. In its WebUI, there is a separate tab
1231-
called "Schema". On this tab, you can define the schema, check its correctness,
1231+
called "Code". On this tab, in the ``schema.yml`` file, you can define the schema, check its correctness,
12321232
and apply it to the whole cluster.
12331233

1234-
If you do not use Cartridge, you can still use the DDL module:
1234+
If you do not use Cartridge, you can still use the DDL module:
12351235
put the following Lua code into the file that you use to run Tarantool.
12361236
This file is usually called ``init.lua``.
12371237

doc/getting_started/getting_started_imcp.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ if you want to get better acquainted with it.
5757
5858
cartridge build
5959
cartridge start
60-
60+
6161
.. note::
6262

6363
In case of a problem with `cartridge build`, run it with the `--verbose` flag
6464
to learn about the source of the problem. If there is a problem with Node.js (`npm`):
65-
65+
6666
1. Check that Node.js is in the `$PATH`.
6767

6868
2. Try forcefully removing the `node_modules` directory from the dependencies' directories:
@@ -154,9 +154,9 @@ located in the top right corner.
154154
Creating a data schema [2 minutes]
155155
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156156

157-
Let's start with the data schema -- take a look at the "Code" tab on the left.
157+
Let's start with the data schema -- take a look at the **Code** tab on the left.
158158

159-
Here we can create a file called ``schema.yml``. In this file, you can
159+
There you can find a file called ``schema.yml``. In this file, you can
160160
describe the entire cluster's data schema, edit the current schema,
161161
validate its correctness, and apply it to the whole cluster.
162162

@@ -168,8 +168,8 @@ We need to store:
168168
* Videos with descriptions
169169
* Likes for each video
170170

171-
Create a ``schema.yml`` file to load the schema into the cluster.
172-
Copy and paste schema to this file. Click the "Apply" button.
171+
Copy the schema description from the code block below and paste it in the ``schema.yml`` file on the **Code** tab.
172+
Click the "Apply" button.
173173
After that, the data schema will be described in the cluster.
174174

175175
This is what our data schema will look like:
@@ -332,14 +332,14 @@ Paste the code below into ``api.lua`` and click "Apply".
332332
function like_video(request)
333333
local video_id = request:post_param("video_id")
334334
local user_id = request:post_param("user_id")
335-
335+
336336
local result, err = crud.insert_object('likes', {like_id = uuid.new(),
337337
video_id = uuid.fromstr(video_id),
338338
user_id = uuid.fromstr(user_id)})
339339
if err ~= nil then
340340
return {body = json.encode({status = "Error!", error = err}), status = 500}
341341
end
342-
342+
343343
return {body = json.encode({status = "Success!", result = result}), status = 200}
344344
end
345345
@@ -365,7 +365,7 @@ Paste the configuration example below into ``config.yml`` and click "Apply".
365365
366366
---
367367
functions:
368-
368+
369369
add_user:
370370
module: extensions.api
371371
handler: add_user
@@ -392,7 +392,7 @@ Done! Let's make test requests from the console.
392392
curl -X POST --data "fullname=Taran Tool" url/add_user
393393
394394
.. note::
395-
395+
396396
In the requests, substitute ``url`` with the address of your sandbox.
397397
The protocol must be strictly HTTP.
398398

@@ -448,7 +448,7 @@ Looking at the data [1 minute]
448448
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
449449

450450
.. note::
451-
451+
452452
The following instructions are for Tarantool Enterprise Edition and the Try Tarantool cloud service.
453453

454454
The Space-Explorer tool is unavailable in the open-source version. Use the console to view data.

0 commit comments

Comments
 (0)