From d0c052c9c187da04775cd6c7cc5d4dc4352f31ed Mon Sep 17 00:00:00 2001 From: Kseniia Antonova Date: Mon, 10 Oct 2022 21:07:18 +0300 Subject: [PATCH 1/8] Update example --- doc/reference/reference_lua/net_box.rst | 99 ++++++++------- .../reference/reference_lua/net_box.po | 119 +----------------- 2 files changed, 52 insertions(+), 166 deletions(-) diff --git a/doc/reference/reference_lua/net_box.rst b/doc/reference/reference_lua/net_box.rst index e4c4792555..ff1ed53b88 100644 --- a/doc/reference/reference_lua/net_box.rst +++ b/doc/reference/reference_lua/net_box.rst @@ -901,7 +901,7 @@ The sandbox configuration for this example assumes that: Here are commands for a quick sandbox setup: -.. code-block:: lua +.. code-block:: lua box.cfg{listen = 3301} s = box.schema.space.create('tester') @@ -911,62 +911,65 @@ Here are commands for a quick sandbox setup: And here starts the example: -.. code-block:: tarantoolsession +.. code-block:: tarantoolsession tarantool> net_box = require('net.box') --- ... - tarantool> function example() - > local conn, wtuple - > if net_box.self:ping() then - > table.insert(ta, 'self:ping() succeeded') - > table.insert(ta, ' (no surprise -- self connection is pre-established)') - > end - > if box.cfg.listen == '3301' then - > table.insert(ta,'The local server listen address = 3301') - > else - > table.insert(ta, 'The local server listen address is not 3301') - > table.insert(ta, '( (maybe box.cfg{...listen="3301"...} was not stated)') - > table.insert(ta, '( (so connect will fail)') - > end - > conn = net_box.connect('127.0.0.1:3301') - > conn.space.tester:delete({800}) - > table.insert(ta, 'conn delete done on tester.') - > conn.space.tester:insert({800, 'data'}) - > table.insert(ta, 'conn insert done on tester, index 0') - > table.insert(ta, ' primary key value = 800.') - > wtuple = conn.space.tester:select({800}) - > table.insert(ta, 'conn select done on tester, index 0') - > table.insert(ta, ' number of fields = ' .. #wtuple) - > conn.space.tester:delete({800}) - > table.insert(ta, 'conn delete done on tester') - > conn.space.tester:replace({800, 'New data', 'Extra data'}) - > table.insert(ta, 'conn:replace done on tester') - > conn.space.tester:update({800}, {{'=', 2, 'Fld#1'}}) - > table.insert(ta, 'conn update done on tester') - > conn:close() - > table.insert(ta, 'conn close done') - > end + -- Self connection is pre-established. + -- In this case, `conn = net_box.connect('localhost:3301')` + -- can be replaced by `conn = net_box.self`. + tarantool> conn = net_box.self --- ... - tarantool> ta = {} + tarantool> conn:ping() --- + - true ... - tarantool> example() + -- Return all tuples where the key value is 600 + tarantool> conn.space.tester:select{800} --- + - - [800, 'TEST'] ... - tarantool> ta + -- Insert tuples + tarantool> conn.space.tester:insert({700, 'TEST700'}) --- - - - self:ping() succeeded - - ' (no surprise -- self connection is pre-established)' - - The local server listen address = 3301 - - conn delete done on tester. - - conn insert done on tester, index 0 - - ' primary key value = 800.' - - conn select done on tester, index 0 - - ' number of fields = 1' - - conn delete done on tester - - conn:replace done on tester - - conn update done on tester - - conn close done + - [700, 'TEST700'] ... + tarantool> conn.space.tester:insert({600, 'TEST600'}) + --- + - [600, 'TEST600'] + ... + -- Search for a tuple where the key value is 600 + tarantool> conn.space.tester:get({600}) + --- + - [600, 'TEST600'] + ... + -- Update the existing tuple + tarantool> conn.space.tester:update(800, {{'=', 2, 'TEST800'}}) + --- + - [800, 'TEST800'] + ... + -- Update the existing tuple + tarantool> conn.space.tester:upsert({500, 'TEST500'}, {{'=', 2, 'TEST'}}) + --- + ... + -- Delete tuples where the key value is 600 + tarantool> conn.space.tester:delete{600} + --- + - [600, 'TEST600'] + ... + -- Replace the existing tuple with a new one + tarantool> conn.space.tester:replace{500, 'New data', 'Extra data'} + --- + - [500, 'New data', 'Extra data'] + ... + -- Select all tuples + tarantool> conn.space.tester:select{} + --- + - - [800, 'TEST800'] + - [500, 'New data', 'Extra data'] + - [700, 'TEST700'] + ... + -- Close the connection + tarantool> conn:close() \ No newline at end of file diff --git a/locale/ru/LC_MESSAGES/reference/reference_lua/net_box.po b/locale/ru/LC_MESSAGES/reference/reference_lua/net_box.po index 965f463575..3f4c3c229b 100644 --- a/locale/ru/LC_MESSAGES/reference/reference_lua/net_box.po +++ b/locale/ru/LC_MESSAGES/reference/reference_lua/net_box.po @@ -1073,7 +1073,7 @@ msgid "" "tuple that contains a key value = 800," msgstr "" "создан спейс под названием ``tester`` с первичным числовым ключом и " -"кортежем, в котором есть ключ со значением= 800," +"кортежем, в котором есть ключ со значением = 800," msgid "the current user has read, write and execute privileges." msgstr "у текущего пользователя есть права на чтение, запись и выполнение." @@ -1096,120 +1096,3 @@ msgstr "" msgid "And here starts the example:" msgstr "А здесь приведен пример:" - -msgid "" -"tarantool> net_box = require('net.box')\n" -"---\n" -"...\n" -"tarantool> function example()\n" -" > local conn, wtuple\n" -" > if net_box.self:ping() then\n" -" > table.insert(ta, 'self:ping() succeeded')\n" -" > table.insert(ta, ' (no surprise -- self connection is pre-established)')\n" -" > end\n" -" > if box.cfg.listen == '3301' then\n" -" > table.insert(ta,'The local server listen address = 3301')\n" -" > else\n" -" > table.insert(ta, 'The local server listen address is not 3301')\n" -" > table.insert(ta, '( (maybe box.cfg{...listen=\"3301\"...} was not stated)')\n" -" > table.insert(ta, '( (so connect will fail)')\n" -" > end\n" -" > conn = net_box.connect('127.0.0.1:3301')\n" -" > conn.space.tester:delete({800})\n" -" > table.insert(ta, 'conn delete done on tester.')\n" -" > conn.space.tester:insert({800, 'data'})\n" -" > table.insert(ta, 'conn insert done on tester, index 0')\n" -" > table.insert(ta, ' primary key value = 800.')\n" -" > wtuple = conn.space.tester:select({800})\n" -" > table.insert(ta, 'conn select done on tester, index 0')\n" -" > table.insert(ta, ' number of fields = ' .. #wtuple)\n" -" > conn.space.tester:delete({800})\n" -" > table.insert(ta, 'conn delete done on tester')\n" -" > conn.space.tester:replace({800, 'New data', 'Extra data'})\n" -" > table.insert(ta, 'conn:replace done on tester')\n" -" > conn.space.tester:update({800}, {{'=', 2, 'Fld#1'}})\n" -" > table.insert(ta, 'conn update done on tester')\n" -" > conn:close()\n" -" > table.insert(ta, 'conn close done')\n" -" > end\n" -"---\n" -"...\n" -"tarantool> ta = {}\n" -"---\n" -"...\n" -"tarantool> example()\n" -"---\n" -"...\n" -"tarantool> ta\n" -"---\n" -"- - self:ping() succeeded\n" -" - ' (no surprise -- self connection is pre-established)'\n" -" - The local server listen address = 3301\n" -" - conn delete done on tester.\n" -" - conn insert done on tester, index 0\n" -" - ' primary key value = 800.'\n" -" - conn select done on tester, index 0\n" -" - ' number of fields = 1'\n" -" - conn delete done on tester\n" -" - conn:replace done on tester\n" -" - conn update done on tester\n" -" - conn close done\n" -"..." -msgstr "" -"tarantool> net_box = require('net.box')\n" -"---\n" -"...\n" -"tarantool> function example()\n" -" > local conn, wtuple\n" -" > if net_box.self:ping() then\n" -" > table.insert(ta, 'self:ping() succeeded')\n" -" > table.insert(ta, ' (no surprise -- self connection is pre-established)')\n" -" > end\n" -" > if box.cfg.listen == '3301' then\n" -" > table.insert(ta,'The local server listen address = 3301')\n" -" > else\n" -" > table.insert(ta, 'The local server listen address is not 3301')\n" -" > table.insert(ta, '( (maybe box.cfg{...listen=\"3301\"...} was not stated)')\n" -" > table.insert(ta, '( (so connect will fail)')\n" -" > end\n" -" > conn = net_box.connect('127.0.0.1:3301')\n" -" > conn.space.tester:delete({800})\n" -" > table.insert(ta, 'conn delete done on tester.')\n" -" > conn.space.tester:insert({800, 'data'})\n" -" > table.insert(ta, 'conn insert done on tester, index 0')\n" -" > table.insert(ta, ' primary key value = 800.')\n" -" > wtuple = conn.space.tester:select({800})\n" -" > table.insert(ta, 'conn select done on tester, index 0')\n" -" > table.insert(ta, ' number of fields = ' .. #wtuple)\n" -" > conn.space.tester:delete({800})\n" -" > table.insert(ta, 'conn delete done on tester')\n" -" > conn.space.tester:replace({800, 'New data', 'Extra data'})\n" -" > table.insert(ta, 'conn:replace done on tester')\n" -" > conn.space.tester:update({800}, {{'=', 2, 'Fld#1'}})\n" -" > table.insert(ta, 'conn update done on tester')\n" -" > conn:close()\n" -" > table.insert(ta, 'conn close done')\n" -" > end\n" -"---\n" -"...\n" -"tarantool> ta = {}\n" -"---\n" -"...\n" -"tarantool> example()\n" -"---\n" -"...\n" -"tarantool> ta\n" -"---\n" -"- - self:ping() succeeded\n" -" - ' (no surprise -- self connection is pre-established)'\n" -" - The local server listen address = 3301\n" -" - conn delete done on tester.\n" -" - conn insert done on tester, index 0\n" -" - ' primary key value = 800.'\n" -" - conn select done on tester, index 0\n" -" - ' number of fields = 1'\n" -" - conn delete done on tester\n" -" - conn:replace done on tester\n" -" - conn update done on tester\n" -" - conn close done\n" -"..." From a65286e28328412853528e7a23f84e0cb2ced30f Mon Sep 17 00:00:00 2001 From: Kseniia Antonova Date: Thu, 13 Oct 2022 18:22:58 +0300 Subject: [PATCH 2/8] Rewrite the example --- doc/reference/reference_lua/net_box.rst | 120 +++++++++++++++++++++++- 1 file changed, 119 insertions(+), 1 deletion(-) diff --git a/doc/reference/reference_lua/net_box.rst b/doc/reference/reference_lua/net_box.rst index ff1ed53b88..7fdaa71e49 100644 --- a/doc/reference/reference_lua/net_box.rst +++ b/doc/reference/reference_lua/net_box.rst @@ -972,4 +972,122 @@ And here starts the example: - [700, 'TEST700'] ... -- Close the connection - tarantool> conn:close() \ No newline at end of file + tarantool> conn:close() + +First, get the ``net.box`` object: + +.. code-block:: tarantoolsession + + tarantool> net_box = require('net.box') + --- + ... + +In ``net.box``, self connection is pre-established. +That is, ``conn = net_box.connect('localhost:3301')`` can be replaced with the following command: + +.. code-block:: tarantoolsession + + tarantool> conn = net_box.self + --- + ... + +Then, make a ping: + +.. code-block:: tarantoolsession + + tarantool> conn:ping() + --- + - true + ... + +Now, let's get to work with the data in the ``tester``space. +The ``select`` command below returns all tuples where the key value is 600: +//добавить еще кортеж с ключом 800 +.. code-block:: tarantoolsession + + tarantool> conn.space.tester:select{800} + --- + - - [800, 'TEST'] + ... + +Now, let's insert two tuples in the space: + +.. code-block:: tarantoolsession + + tarantool> conn.space.tester:insert({700, 'TEST700'}) + --- + - [700, 'TEST700'] + ... + tarantool> conn.space.tester:insert({600, 'TEST600'}) + --- + - [600, 'TEST600'] + ... + +After the insert, we have one tuple where the key value is ``600``. +To select this tuple, you can use the ``get()`` method. +Unlike the ``select()`` command, ``get()`` returns only one tuple that satisfies the stated condition. + +.. code-block:: tarantoolsession + + tarantool> conn.space.tester:get({600}) + --- + - [600, 'TEST600'] + ... + +To update the existing tuple, you can use either ``update()`` or ``upsert``. +Use the first one to ... + +.. code-block:: tarantoolsession + + -- Update the existing tuple + tarantool> conn.space.tester:update(800, {{'=', 2, 'TEST800'}}) + --- + - [800, 'TEST800'] + ... + +Use ``upsert`` to... + +.. code-block:: tarantoolsession + + -- Update the existing tuple + tarantool> conn.space.tester:upsert({500, 'TEST500'}, {{'=', 2, 'TEST'}}) + --- + ... + +To delete a tuple, run the method below: + +.. code-block:: tarantoolsession + + -- Delete tuples where the key value is 600 + tarantool> conn.space.tester:delete{600} + --- + - [600, 'TEST600'] + ... + +Now, let's replace the existing tuple with a new one + +.. code-block:: tarantoolsession + + tarantool> conn.space.tester:replace{500, 'New data', 'Extra data'} + --- + - [500, 'New data', 'Extra data'] + ... + +Finally, let's select all tuples stored in the space: + +.. code-block:: tarantoolsession + + tarantool> conn.space.tester:select{} + --- + - - [800, 'TEST800'] + - [500, 'New data', 'Extra data'] + - [700, 'TEST700'] + ... + +In the end, close the connection when it is no longer needed: + +.. code-block:: tarantoolsession + + tarantool> conn:close() + --- + ... \ No newline at end of file From a3d07c63cd8c478163ce6970b646debd6f32d2f7 Mon Sep 17 00:00:00 2001 From: Kseniia Antonova Date: Fri, 14 Oct 2022 18:22:25 +0300 Subject: [PATCH 3/8] Move text to how-to section --- doc/how-to/getting_started_net_box.rst | 157 +++++++++++++ doc/how-to/index.rst | 1 + doc/reference/reference_lua/net_box.rst | 208 +----------------- .../reference/reference_lua/net_box.po | 2 +- 4 files changed, 160 insertions(+), 208 deletions(-) create mode 100644 doc/how-to/getting_started_net_box.rst diff --git a/doc/how-to/getting_started_net_box.rst b/doc/how-to/getting_started_net_box.rst new file mode 100644 index 0000000000..3b73699f53 --- /dev/null +++ b/doc/how-to/getting_started_net_box.rst @@ -0,0 +1,157 @@ +.. _getting_started_net_box: + +Getting started with net.box +============================ + +The tutorial shows the use of some of the ``net.box`` methods. + +For more information about the ``net.box`` module, +check the :ref:`corresponding module reference `. + +Sandbox configuration +--------------------- + +The sandbox configuration for the tutorial assumes that: + +* The Tarantool instance is running on ``localhost 127.0.0.1:3301``. +* There is a space named ``tester`` with a numeric primary key. +* The space contains a tuple with a key value = ``800``. +* The current user has read, write, and execute privileges. + +Use the commands below for a quick sandbox setup: + +.. code-block:: lua + + box.cfg{listen = 3301} + s = box.schema.space.create('tester') + s:create_index('primary', {type = 'hash', parts = {1, 'unsigned'}}) + t = s:insert({800, 'TEST'}) + box.schema.user.grant('guest', 'read,write,execute', 'universe') + +Creating a net.box connection +----------------------------- + +To start working with ``net.box``, get the ``net.box`` object: + +.. code-block:: tarantoolsession + + tarantool> net_box = require('net.box') + --- + ... + +During the sandbox setup, ``box.cfg{...listen="3301"`` was called. +It means that the local server listen address is ``3301``. +If the connection fails, check the actual listen address. + +The next step is to create a new connection. +In ``net.box``, self connection is pre-established. +That is, ``conn = net_box.connect('localhost:3301')`` can be replaced with the following command: + +.. code-block:: tarantoolsession + + tarantool> conn = net_box.self + --- + ... + +Then, make a ping: + +.. code-block:: tarantoolsession + + tarantool> conn:ping() + --- + - true + ... + +Manipulating data +----------------- + +The ``select`` command below returns all tuples in the ``tester`` space where the key value is 800: + +.. code-block:: tarantoolsession + + tarantool> conn.space.tester:select{800} + --- + - - [800, 'TEST'] + ... + +Now, let's insert two tuples in the space: + +.. code-block:: tarantoolsession + + tarantool> conn.space.tester:insert({700, 'TEST700'}) + --- + - [700, 'TEST700'] + ... + tarantool> conn.space.tester:insert({600, 'TEST600'}) + --- + - [600, 'TEST600'] + ... + +After the insert, we have one tuple where the key value is ``600``. +To select this tuple, you can use the ``get()`` method. +Unlike the ``select()`` command, ``get()`` returns only one tuple that satisfies the stated condition. + +.. code-block:: tarantoolsession + + tarantool> conn.space.tester:get({600}) + --- + - [600, 'TEST600'] + ... + +To update the existing tuple, you can use either ``update()`` or ``upsert``. +Use the first one to ... + +.. code-block:: tarantoolsession + + -- Update the existing tuple + tarantool> conn.space.tester:update(800, {{'=', 2, 'TEST800'}}) + --- + - [800, 'TEST800'] + ... + +Use ``upsert`` to... + +.. code-block:: tarantoolsession + + -- Update the existing tuple + tarantool> conn.space.tester:upsert({500, 'TEST500'}, {{'=', 2, 'TEST'}}) + --- + ... + +To delete a tuple, run the method below: + +.. code-block:: tarantoolsession + + -- Delete tuples where the key value is 600 + tarantool> conn.space.tester:delete{600} + --- + - [600, 'TEST600'] + ... + +Now, let's replace the existing tuple with a new one + +.. code-block:: tarantoolsession + + tarantool> conn.space.tester:replace{500, 'New data', 'Extra data'} + --- + - [500, 'New data', 'Extra data'] + ... + +Finally, let's select all tuples stored in the space: + +.. code-block:: tarantoolsession + + tarantool> conn.space.tester:select{} + --- + - - [800, 'TEST800'] + - [500, 'New data', 'Extra data'] + - [700, 'TEST700'] + ... + +In the end, close the connection when it is no longer needed: + +.. code-block:: tarantoolsession + + tarantool> conn:close() + --- + ... \ No newline at end of file diff --git a/doc/how-to/index.rst b/doc/how-to/index.rst index 88f3459434..546db4f367 100644 --- a/doc/how-to/index.rst +++ b/doc/how-to/index.rst @@ -20,6 +20,7 @@ If you are new to Tarantool, please see our getting_started_connectors getting_started_cartridge db/index + getting_started_net_box vshard_quick app/index replication/index diff --git a/doc/reference/reference_lua/net_box.rst b/doc/reference/reference_lua/net_box.rst index 7fdaa71e49..c326bacfb5 100644 --- a/doc/reference/reference_lua/net_box.rst +++ b/doc/reference/reference_lua/net_box.rst @@ -884,210 +884,4 @@ With the ``net.box`` module, you can use the following existing trigger functions. Details about trigger characteristics are in the - :ref:`triggers ` section. - -============================================================================ -Example -============================================================================ - -This example shows the use of most of the ``net.box`` methods. - -The sandbox configuration for this example assumes that: - -* the Tarantool instance is running on ``localhost 127.0.0.1:3301``, -* there is a space named ``tester`` with a numeric primary key and with a tuple - that contains a key value = 800, -* the current user has read, write and execute privileges. - -Here are commands for a quick sandbox setup: - -.. code-block:: lua - - box.cfg{listen = 3301} - s = box.schema.space.create('tester') - s:create_index('primary', {type = 'hash', parts = {1, 'unsigned'}}) - t = s:insert({800, 'TEST'}) - box.schema.user.grant('guest', 'read,write,execute', 'universe') - -And here starts the example: - -.. code-block:: tarantoolsession - - tarantool> net_box = require('net.box') - --- - ... - -- Self connection is pre-established. - -- In this case, `conn = net_box.connect('localhost:3301')` - -- can be replaced by `conn = net_box.self`. - tarantool> conn = net_box.self - --- - ... - tarantool> conn:ping() - --- - - true - ... - -- Return all tuples where the key value is 600 - tarantool> conn.space.tester:select{800} - --- - - - [800, 'TEST'] - ... - -- Insert tuples - tarantool> conn.space.tester:insert({700, 'TEST700'}) - --- - - [700, 'TEST700'] - ... - tarantool> conn.space.tester:insert({600, 'TEST600'}) - --- - - [600, 'TEST600'] - ... - -- Search for a tuple where the key value is 600 - tarantool> conn.space.tester:get({600}) - --- - - [600, 'TEST600'] - ... - -- Update the existing tuple - tarantool> conn.space.tester:update(800, {{'=', 2, 'TEST800'}}) - --- - - [800, 'TEST800'] - ... - -- Update the existing tuple - tarantool> conn.space.tester:upsert({500, 'TEST500'}, {{'=', 2, 'TEST'}}) - --- - ... - -- Delete tuples where the key value is 600 - tarantool> conn.space.tester:delete{600} - --- - - [600, 'TEST600'] - ... - -- Replace the existing tuple with a new one - tarantool> conn.space.tester:replace{500, 'New data', 'Extra data'} - --- - - [500, 'New data', 'Extra data'] - ... - -- Select all tuples - tarantool> conn.space.tester:select{} - --- - - - [800, 'TEST800'] - - [500, 'New data', 'Extra data'] - - [700, 'TEST700'] - ... - -- Close the connection - tarantool> conn:close() - -First, get the ``net.box`` object: - -.. code-block:: tarantoolsession - - tarantool> net_box = require('net.box') - --- - ... - -In ``net.box``, self connection is pre-established. -That is, ``conn = net_box.connect('localhost:3301')`` can be replaced with the following command: - -.. code-block:: tarantoolsession - - tarantool> conn = net_box.self - --- - ... - -Then, make a ping: - -.. code-block:: tarantoolsession - - tarantool> conn:ping() - --- - - true - ... - -Now, let's get to work with the data in the ``tester``space. -The ``select`` command below returns all tuples where the key value is 600: -//добавить еще кортеж с ключом 800 -.. code-block:: tarantoolsession - - tarantool> conn.space.tester:select{800} - --- - - - [800, 'TEST'] - ... - -Now, let's insert two tuples in the space: - -.. code-block:: tarantoolsession - - tarantool> conn.space.tester:insert({700, 'TEST700'}) - --- - - [700, 'TEST700'] - ... - tarantool> conn.space.tester:insert({600, 'TEST600'}) - --- - - [600, 'TEST600'] - ... - -After the insert, we have one tuple where the key value is ``600``. -To select this tuple, you can use the ``get()`` method. -Unlike the ``select()`` command, ``get()`` returns only one tuple that satisfies the stated condition. - -.. code-block:: tarantoolsession - - tarantool> conn.space.tester:get({600}) - --- - - [600, 'TEST600'] - ... - -To update the existing tuple, you can use either ``update()`` or ``upsert``. -Use the first one to ... - -.. code-block:: tarantoolsession - - -- Update the existing tuple - tarantool> conn.space.tester:update(800, {{'=', 2, 'TEST800'}}) - --- - - [800, 'TEST800'] - ... - -Use ``upsert`` to... - -.. code-block:: tarantoolsession - - -- Update the existing tuple - tarantool> conn.space.tester:upsert({500, 'TEST500'}, {{'=', 2, 'TEST'}}) - --- - ... - -To delete a tuple, run the method below: - -.. code-block:: tarantoolsession - - -- Delete tuples where the key value is 600 - tarantool> conn.space.tester:delete{600} - --- - - [600, 'TEST600'] - ... - -Now, let's replace the existing tuple with a new one - -.. code-block:: tarantoolsession - - tarantool> conn.space.tester:replace{500, 'New data', 'Extra data'} - --- - - [500, 'New data', 'Extra data'] - ... - -Finally, let's select all tuples stored in the space: - -.. code-block:: tarantoolsession - - tarantool> conn.space.tester:select{} - --- - - - [800, 'TEST800'] - - [500, 'New data', 'Extra data'] - - [700, 'TEST700'] - ... - -In the end, close the connection when it is no longer needed: - -.. code-block:: tarantoolsession - - tarantool> conn:close() - --- - ... \ No newline at end of file + :ref:`triggers ` section. \ No newline at end of file diff --git a/locale/ru/LC_MESSAGES/reference/reference_lua/net_box.po b/locale/ru/LC_MESSAGES/reference/reference_lua/net_box.po index 3f4c3c229b..e86ed9f99f 100644 --- a/locale/ru/LC_MESSAGES/reference/reference_lua/net_box.po +++ b/locale/ru/LC_MESSAGES/reference/reference_lua/net_box.po @@ -1070,7 +1070,7 @@ msgstr "экземпляр Tarantool запущен на ``localhost 127.0.0.1:3 msgid "" "there is a space named ``tester`` with a numeric primary key and with a " -"tuple that contains a key value = 800," +"tuple that contains a key value = ``800``," msgstr "" "создан спейс под названием ``tester`` с первичным числовым ключом и " "кортежем, в котором есть ключ со значением = 800," From 40f5e2e8943d01cba1f8203626d33a94a0e0d539 Mon Sep 17 00:00:00 2001 From: Kseniia Antonova Date: Mon, 17 Oct 2022 13:23:11 +0300 Subject: [PATCH 4/8] Update the example --- doc/how-to/getting_started_net_box.rst | 42 ++++++++++++------------- doc/reference/reference_lua/net_box.rst | 1 + 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/doc/how-to/getting_started_net_box.rst b/doc/how-to/getting_started_net_box.rst index 3b73699f53..1fa505e10d 100644 --- a/doc/how-to/getting_started_net_box.rst +++ b/doc/how-to/getting_started_net_box.rst @@ -3,7 +3,7 @@ Getting started with net.box ============================ -The tutorial shows the use of some of the ``net.box`` methods. +The tutorial shows how to work with some common ``net.box`` methods. For more information about the ``net.box`` module, check the :ref:`corresponding module reference `. @@ -15,7 +15,7 @@ The sandbox configuration for the tutorial assumes that: * The Tarantool instance is running on ``localhost 127.0.0.1:3301``. * There is a space named ``tester`` with a numeric primary key. -* The space contains a tuple with a key value = ``800``. +* The space contains a tuple with the key value = ``800``. * The current user has read, write, and execute privileges. Use the commands below for a quick sandbox setup: @@ -31,27 +31,23 @@ Use the commands below for a quick sandbox setup: Creating a net.box connection ----------------------------- -To start working with ``net.box``, get the ``net.box`` object: +First, load the ``net.box`` module with: .. code-block:: tarantoolsession tarantool> net_box = require('net.box') - --- - ... -During the sandbox setup, ``box.cfg{...listen="3301"`` was called. +During the sandbox setup, ``box.cfg{...listen="3301"}`` was called. It means that the local server listen address is ``3301``. If the connection fails, check the actual listen address. The next step is to create a new connection. -In ``net.box``, self connection is pre-established. +In ``net.box``, self-connection is pre-established. That is, ``conn = net_box.connect('localhost:3301')`` can be replaced with the following command: .. code-block:: tarantoolsession tarantool> conn = net_box.self - --- - ... Then, make a ping: @@ -62,10 +58,10 @@ Then, make a ping: - true ... -Manipulating data ------------------ +Using data operations +--------------------- -The ``select`` command below returns all tuples in the ``tester`` space where the key value is 800: +The ``select()`` command below returns all tuples in the ``tester`` space where the key value is ``800``: .. code-block:: tarantoolsession @@ -74,7 +70,7 @@ The ``select`` command below returns all tuples in the ``tester`` space where th - - [800, 'TEST'] ... -Now, let's insert two tuples in the space: +Insert two tuples into the space: .. code-block:: tarantoolsession @@ -98,25 +94,27 @@ Unlike the ``select()`` command, ``get()`` returns only one tuple that satisfies - [600, 'TEST600'] ... -To update the existing tuple, you can use either ``update()`` or ``upsert``. -Use the first one to ... +To update the existing tuple, you can use either ``update()`` or ``upsert()``. +The ``update()`` method can be used for assignment, arithmetic (if the field is numeric), +cutting and pasting fragments of a field, and deleting or inserting a field. + +The command below is used to update the tuple identified by primary key value = ``800``. +The operation assigns a new value to the second field in the tuple: .. code-block:: tarantoolsession - -- Update the existing tuple tarantool> conn.space.tester:update(800, {{'=', 2, 'TEST800'}}) --- - [800, 'TEST800'] ... -Use ``upsert`` to... +As for the ``upsert`` function, if there is an existing tuple which matches the key field of tuple, then the command +has the same effect as ``update()``. +Otherwise, the effect is equal to the ``insert()`` method. .. code-block:: tarantoolsession - -- Update the existing tuple tarantool> conn.space.tester:upsert({500, 'TEST500'}, {{'=', 2, 'TEST'}}) - --- - ... To delete a tuple, run the method below: @@ -128,7 +126,7 @@ To delete a tuple, run the method below: - [600, 'TEST600'] ... -Now, let's replace the existing tuple with a new one +Then, replace the existing tuple with a new one .. code-block:: tarantoolsession @@ -137,7 +135,7 @@ Now, let's replace the existing tuple with a new one - [500, 'New data', 'Extra data'] ... -Finally, let's select all tuples stored in the space: +Finally, select all tuples from the space: .. code-block:: tarantoolsession diff --git a/doc/reference/reference_lua/net_box.rst b/doc/reference/reference_lua/net_box.rst index c326bacfb5..51d430f78d 100644 --- a/doc/reference/reference_lua/net_box.rst +++ b/doc/reference/reference_lua/net_box.rst @@ -13,6 +13,7 @@ variant, to be discussed later, is for connecting to MySQL or MariaDB or Postgre (see :ref:`SQL DBMS modules ` reference). The other variant, which is discussed in this section, is for connecting to Tarantool server instances via a network. +For a quick start with ``net.box``, refer to the :ref:`tutorial `. You can call the following methods: From 7529c97cf70f2eeed2a34f1f811f90934b8b566c Mon Sep 17 00:00:00 2001 From: Kseniia Antonova Date: Tue, 18 Oct 2022 10:23:07 +0300 Subject: [PATCH 5/8] Apply suggestions from review --- doc/how-to/getting_started_net_box.rst | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/doc/how-to/getting_started_net_box.rst b/doc/how-to/getting_started_net_box.rst index 1fa505e10d..edf2eb13eb 100644 --- a/doc/how-to/getting_started_net_box.rst +++ b/doc/how-to/getting_started_net_box.rst @@ -31,7 +31,7 @@ Use the commands below for a quick sandbox setup: Creating a net.box connection ----------------------------- -First, load the ``net.box`` module with: +First, load the ``net.box`` module with the ``require('net.box')`` method: .. code-block:: tarantoolsession @@ -43,7 +43,7 @@ If the connection fails, check the actual listen address. The next step is to create a new connection. In ``net.box``, self-connection is pre-established. -That is, ``conn = net_box.connect('localhost:3301')`` can be replaced with the following command: +That is, ``conn = net_box.connect('localhost:3301')`` can be replaced with the ``conn = net_box.self`` object call: .. code-block:: tarantoolsession @@ -61,7 +61,7 @@ Then, make a ping: Using data operations --------------------- -The ``select()`` command below returns all tuples in the ``tester`` space where the key value is ``800``: +Select all tuples in the ``tester`` space where the key value is ``800``: .. code-block:: tarantoolsession @@ -83,7 +83,7 @@ Insert two tuples into the space: - [600, 'TEST600'] ... -After the insert, we have one tuple where the key value is ``600``. +After the insert, there is one tuple where the key value is ``600``. To select this tuple, you can use the ``get()`` method. Unlike the ``select()`` command, ``get()`` returns only one tuple that satisfies the stated condition. @@ -98,7 +98,7 @@ To update the existing tuple, you can use either ``update()`` or ``upsert()``. The ``update()`` method can be used for assignment, arithmetic (if the field is numeric), cutting and pasting fragments of a field, and deleting or inserting a field. -The command below is used to update the tuple identified by primary key value = ``800``. +In this tutorial, the ``update()`` command is used to update the tuple identified by primary key value = ``800``. The operation assigns a new value to the second field in the tuple: .. code-block:: tarantoolsession @@ -116,17 +116,16 @@ Otherwise, the effect is equal to the ``insert()`` method. tarantool> conn.space.tester:upsert({500, 'TEST500'}, {{'=', 2, 'TEST'}}) -To delete a tuple, run the method below: +To delete a tuple where the key value is ``600``, run the ``delete()`` method below: .. code-block:: tarantoolsession - -- Delete tuples where the key value is 600 tarantool> conn.space.tester:delete{600} --- - [600, 'TEST600'] ... -Then, replace the existing tuple with a new one +Then, replace the existing tuple with a new one: .. code-block:: tarantoolsession @@ -146,6 +145,9 @@ Finally, select all tuples from the space: - [700, 'TEST700'] ... +Closing the connection +---------------------- + In the end, close the connection when it is no longer needed: .. code-block:: tarantoolsession From 03d6fe81f4f2bb57565eee5f7a4dc508850df18b Mon Sep 17 00:00:00 2001 From: Kseniia Antonova Date: Tue, 18 Oct 2022 12:04:58 +0300 Subject: [PATCH 6/8] Translate page, update translation --- doc/how-to/getting_started_net_box.rst | 8 +- .../how-to/getting_started_net_box.po | 128 ++++++++++++++++++ .../reference/reference_lua/net_box.po | 50 +------ 3 files changed, 135 insertions(+), 51 deletions(-) create mode 100644 locale/ru/LC_MESSAGES/how-to/getting_started_net_box.po diff --git a/doc/how-to/getting_started_net_box.rst b/doc/how-to/getting_started_net_box.rst index edf2eb13eb..154892bce4 100644 --- a/doc/how-to/getting_started_net_box.rst +++ b/doc/how-to/getting_started_net_box.rst @@ -37,13 +37,9 @@ First, load the ``net.box`` module with the ``require('net.box')`` method: tarantool> net_box = require('net.box') -During the sandbox setup, ``box.cfg{...listen="3301"}`` was called. -It means that the local server listen address is ``3301``. -If the connection fails, check the actual listen address. - The next step is to create a new connection. In ``net.box``, self-connection is pre-established. -That is, ``conn = net_box.connect('localhost:3301')`` can be replaced with the ``conn = net_box.self`` object call: +That is, ``conn = net_box.connect('localhost:3301')`` command can be replaced with the ``conn = net_box.self`` object call: .. code-block:: tarantoolsession @@ -108,7 +104,7 @@ The operation assigns a new value to the second field in the tuple: - [800, 'TEST800'] ... -As for the ``upsert`` function, if there is an existing tuple which matches the key field of tuple, then the command +As for the ``upsert`` function, if there is an existing tuple that matches the key field of tuple, then the command has the same effect as ``update()``. Otherwise, the effect is equal to the ``insert()`` method. diff --git a/locale/ru/LC_MESSAGES/how-to/getting_started_net_box.po b/locale/ru/LC_MESSAGES/how-to/getting_started_net_box.po new file mode 100644 index 0000000000..6d81543142 --- /dev/null +++ b/locale/ru/LC_MESSAGES/how-to/getting_started_net_box.po @@ -0,0 +1,128 @@ + +msgid "Getting started with net.box" +msgstr "Начало работы с net.box" + +msgid "The tutorial shows how to work with some common ``net.box`` methods." +msgstr "Ниже приводится пример использования большинства методов ``net.box``." + +msgid "" +"For more information about the ``net.box`` module, " +"check the :ref:`corresponding module reference `." +msgstr "Подробную информацию о модуле ``net.box`` вы найдете " +"в соответствующем :ref:`разделе справочника по модулям `." + +msgid "Sandbox configuration" +msgstr "Настройка песочницы" + +msgid "The sandbox configuration for the tutorial assumes that:" +msgstr "" +"Данный пример сработает на конфигурации из песочницы, предполагается, что:" + +msgid "The Tarantool instance is running on ``localhost 127.0.0.1:3301``." +msgstr "экземпляр Tarantool запущен на ``localhost 127.0.0.1:3301``;" + +msgid "There is a space named ``tester`` with a numeric primary key." +msgstr "создан спейс под названием ``tester`` с первичным числовым ключом;" + +msgid "The space contains a tuple with the key value = ``800``." +mgstr "спейс содержит кортеж, в котором есть ключ со значением = 800;" + +msgid "The current user has read, write, and execute privileges." +msgstr "у текущего пользователя есть права на чтение, запись и выполнение." + +msgid "Use the commands below for a quick sandbox setup:" +msgstr "Используйте команды ниже для быстрой настройки песочницы:" + +msgid "Creating a net.box connection" +msgstr "Создание подключения" + +msgid "" +"First, load the ``net.box`` module with " +"the ``require('net.box')`` method:" +msgstr "" +"Чтобы начать работу, запустите модуль ``net.box``, " +"используя команду ``require('net.box'):`` + +msgid "" +"The next step is to create a new connection." +"In ``net.box``, self-connection is pre-established. That is, " +"``conn = net_box.connect('localhost:3301')`` command can be " +"replaced with the ``conn = net_box.self`` object call:" +msgstr "" +"Далее необходимо создать новое подключение." +"В ``net.box`` для локального Tarantool-сервера есть заданный объект ``self`` всегда" +" установленного подключения. Таким образом, команду ``conn = net_box.connect('localhost:3301')`` " +"можно заменить на вызов объекта ``conn = net_box.self``." + +msgid "Then, make a ping:" +msgstr "Запустите команду ``ping()``:" + +msgid "Using data operations" +msgstr "Операции с данными" + +msgid "Select all tuples in the ``tester`` space where the key value is ``800``:" +msgstr "Сделайте выборку всех кортежей в спейсе ``tester``, где значение ключа равно ``800``:" + +msgid "Insert two tuples into the space:" +msgstr "Вставьте два кортежа в спейс:" + +msgid "" +"After the insert, there is one tuple where the key value is ``600``." +"To select this tuple, you can use the ``get()`` method." +"Unlike the ``select()`` command, ``get()`` returns only one tuple " +"that satisfies the stated condition." +msgstr "" +"После вставки в спейсе появился один кортеж со значением ключа ``600``." +"Для выбора этого кортежа вы можете использовать метод ``get()``." +"В отличие от команды ``select()``, метод ``get()`` возвращает только один кортеж, " +"удовлетворяющий условиям." + +msgid "" +"To update the existing tuple, you can use either ``update()`` or ``upsert()``." +"The ``update()`` method can be used for assignment, " +"arithmetic (if the field is numeric), " +"cutting and pasting fragments of a field, and deleting or inserting a field." +msgstr "" +"Чтобы обновить существующий кортеж, вы можете использовать как метод ``update()``, так и метод ``upsert()``." +"Функция ``update()`` может использоваться для присваивания, " +"арифметических операций (если поле числовое), вырезания и вставки фрагментов" +" поля, а также для удаления или вставки поля." + +msgid "" +"In this tutorial, the ``update()`` command is used to update the tuple " +"identified by primary key value = ``800``." +"The operation assigns a new value to the second field in the tuple:" +msgstr "" +"В этом руководстве команда ``update()`` используется для обновления кортежа, " +"определенного значением ключа ``800``." +"Операция присваивает новое значение второму полю в кортеже:" + +msgid "" +"As for the ``upsert`` function, if there is an existing tuple " +"that matches the key field of tuple, then the command " +"has the same effect as ``update()``. " +"Otherwise, the effect is equal to the ``insert()`` method." +msgstr "" +"Для функции ``upsert``, если уже существует кортеж, " +"который совпадает с ключевыми полями tuple, запрос приведет к тому же " +"результату, что и метод ``update()``. Если нет кортежа, совпадающего с ключевыми полями tuple," +" запрос приведет к тому же результату, что и метод space_object:insert(), + +msgid "" +"To delete a tuple where the key value is ``600``, " +"run the ``delete()`` method below:" +msgstr "" +"Чтобы удалить кортеж, где значение ключа равно ``600`, " +"запустите метод ``delete()``:" + +msgid "Then, replace the existing tuple with a new one:" +msgstr "Затем замените существующий кортеж на новый:" + +msgid "Finally, select all tuples from the space:" +msgstr "Наконец, сделайте выборку по всем кортежам из спейса:" + +msgid "Closing the connection" +msgstr "Закрытие подключения" + +msgid "In the end, close the connection when it is no longer needed:" +msgstr "Закройте соединение явным образом, когда оно больше не используется:" diff --git a/locale/ru/LC_MESSAGES/reference/reference_lua/net_box.po b/locale/ru/LC_MESSAGES/reference/reference_lua/net_box.po index e86ed9f99f..df953112d6 100644 --- a/locale/ru/LC_MESSAGES/reference/reference_lua/net_box.po +++ b/locale/ru/LC_MESSAGES/reference/reference_lua/net_box.po @@ -10,14 +10,16 @@ msgid "" "variant, to be discussed later, is for connecting to MySQL or MariaDB or " "PostgreSQL (see :ref:`SQL DBMS modules ` reference). The other" " variant, which is discussed in this section, is for connecting to Tarantool" -" server instances via a network." +" server instances via a network. For a quick start with ``net.box``, " +"refer to the :ref:`tutorial `." msgstr "" "Модуль ``net.box`` включает в себя коннекторы для удаленных систем с базами " "данных. Одним из вариантов, который рассматривается позднее, является " "подключение к MySQL, MariaDB или PostgreSQL (см. справочник по :ref:`Модулям" " СУБД SQL `). Другим вариантом, который рассматривается в " "данном разделе, является подключение к экземплярам Tarantool-сервера по " -"сети." +"сети. Для быстрого знакомства с ``net.box``, вы можете обратиться к разделу" +" :ref:`Начало работы с net.box `." msgid "You can call the following methods:" msgstr "Можно вызвать следующие методы:" @@ -1053,46 +1055,4 @@ msgid "" "box_triggers>` section." msgstr "" "Подробная информация о характеристиках триггера находится в разделе " -":ref:`Триггеры `." - -msgid "Example" -msgstr "Пример" - -msgid "This example shows the use of most of the ``net.box`` methods." -msgstr "Ниже приводится пример использования большинства методов ``net.box``." - -msgid "The sandbox configuration for this example assumes that:" -msgstr "" -"Данный пример сработает на конфигурации из песочницы, предполагается, что:" - -msgid "the Tarantool instance is running on ``localhost 127.0.0.1:3301``," -msgstr "экземпляр Tarantool запущен на ``localhost 127.0.0.1:3301``," - -msgid "" -"there is a space named ``tester`` with a numeric primary key and with a " -"tuple that contains a key value = ``800``," -msgstr "" -"создан спейс под названием ``tester`` с первичным числовым ключом и " -"кортежем, в котором есть ключ со значением = 800," - -msgid "the current user has read, write and execute privileges." -msgstr "у текущего пользователя есть права на чтение, запись и выполнение." - -msgid "Here are commands for a quick sandbox setup:" -msgstr "Ниже приведены команды для быстрой настройки песочницы:" - -msgid "" -"box.cfg{listen = 3301}\n" -"s = box.schema.space.create('tester')\n" -"s:create_index('primary', {type = 'hash', parts = {1, 'unsigned'}})\n" -"t = s:insert({800, 'TEST'})\n" -"box.schema.user.grant('guest', 'read,write,execute', 'universe')" -msgstr "" -"box.cfg{listen = 3301}\n" -"s = box.schema.space.create('tester')\n" -"s:create_index('primary', {type = 'hash', parts = {1, 'unsigned'}})\n" -"t = s:insert({800, 'TEST'})\n" -"box.schema.user.grant('guest', 'read,write,execute', 'universe')" - -msgid "And here starts the example:" -msgstr "А здесь приведен пример:" +":ref:`Триггеры `." \ No newline at end of file From 9b41bc79d9af2816b18f875f54f47d0d6210a7cb Mon Sep 17 00:00:00 2001 From: Kseniia Antonova Date: Tue, 18 Oct 2022 13:29:57 +0300 Subject: [PATCH 7/8] Update translation --- locale/ru/LC_MESSAGES/how-to/getting_started_net_box.po | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/locale/ru/LC_MESSAGES/how-to/getting_started_net_box.po b/locale/ru/LC_MESSAGES/how-to/getting_started_net_box.po index 6d81543142..873222dc2f 100644 --- a/locale/ru/LC_MESSAGES/how-to/getting_started_net_box.po +++ b/locale/ru/LC_MESSAGES/how-to/getting_started_net_box.po @@ -8,7 +8,8 @@ msgstr "Ниже приводится пример использования б msgid "" "For more information about the ``net.box`` module, " "check the :ref:`corresponding module reference `." -msgstr "Подробную информацию о модуле ``net.box`` вы найдете " +msgstr "" +"Подробную информацию о модуле ``net.box`` вы найдете " "в соответствующем :ref:`разделе справочника по модулям `." msgid "Sandbox configuration" @@ -25,7 +26,7 @@ msgid "There is a space named ``tester`` with a numeric primary key." msgstr "создан спейс под названием ``tester`` с первичным числовым ключом;" msgid "The space contains a tuple with the key value = ``800``." -mgstr "спейс содержит кортеж, в котором есть ключ со значением = 800;" +msgstr "спейс содержит кортеж, в котором есть ключ со значением = 800;" msgid "The current user has read, write, and execute privileges." msgstr "у текущего пользователя есть права на чтение, запись и выполнение." From 53a5ff15fb4aa311424204ae35fc6a9bcbdca761 Mon Sep 17 00:00:00 2001 From: Kseniia Antonova Date: Tue, 18 Oct 2022 13:51:56 +0300 Subject: [PATCH 8/8] Update translation --- .../how-to/getting_started_net_box.po | 36 +++++++++---------- .../reference/reference_lua/net_box.po | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/locale/ru/LC_MESSAGES/how-to/getting_started_net_box.po b/locale/ru/LC_MESSAGES/how-to/getting_started_net_box.po index 873222dc2f..2d551ae658 100644 --- a/locale/ru/LC_MESSAGES/how-to/getting_started_net_box.po +++ b/locale/ru/LC_MESSAGES/how-to/getting_started_net_box.po @@ -42,17 +42,17 @@ msgid "" "the ``require('net.box')`` method:" msgstr "" "Чтобы начать работу, запустите модуль ``net.box``, " -"используя команду ``require('net.box'):`` +"используя команду ``require('net.box')``:" msgid "" -"The next step is to create a new connection." +"The next step is to create a new connection. " "In ``net.box``, self-connection is pre-established. That is, " "``conn = net_box.connect('localhost:3301')`` command can be " "replaced with the ``conn = net_box.self`` object call:" msgstr "" -"Далее необходимо создать новое подключение." -"В ``net.box`` для локального Tarantool-сервера есть заданный объект ``self`` всегда" -" установленного подключения. Таким образом, команду ``conn = net_box.connect('localhost:3301')`` " +"Далее необходимо создать новое подключение. " +"В ``net.box`` для локального Tarantool-сервера есть заданный объект ``self`` всегда " +"установленного подключения. Таким образом, команду ``conn = net_box.connect('localhost:3301')`` " "можно заменить на вызов объекта ``conn = net_box.self``." msgid "Then, make a ping:" @@ -62,40 +62,40 @@ msgid "Using data operations" msgstr "Операции с данными" msgid "Select all tuples in the ``tester`` space where the key value is ``800``:" -msgstr "Сделайте выборку всех кортежей в спейсе ``tester``, где значение ключа равно ``800``:" +msgstr "Сделайте выборку всех кортежей в спейсе ``tester``, у которых значение ключа равно ``800``:" msgid "Insert two tuples into the space:" msgstr "Вставьте два кортежа в спейс:" msgid "" -"After the insert, there is one tuple where the key value is ``600``." -"To select this tuple, you can use the ``get()`` method." +"After the insert, there is one tuple where the key value is ``600``. " +"To select this tuple, you can use the ``get()`` method. " "Unlike the ``select()`` command, ``get()`` returns only one tuple " "that satisfies the stated condition." msgstr "" -"После вставки в спейсе появился один кортеж со значением ключа ``600``." -"Для выбора этого кортежа вы можете использовать метод ``get()``." +"После вставки в спейсе появился один кортеж со значением ключа ``600``. " +"Для выбора этого кортежа вы можете использовать метод ``get()``. " "В отличие от команды ``select()``, метод ``get()`` возвращает только один кортеж, " -"удовлетворяющий условиям." +"удовлетворяющий заданным условиям." msgid "" -"To update the existing tuple, you can use either ``update()`` or ``upsert()``." +"To update the existing tuple, you can use either ``update()`` or ``upsert()``. " "The ``update()`` method can be used for assignment, " "arithmetic (if the field is numeric), " "cutting and pasting fragments of a field, and deleting or inserting a field." msgstr "" -"Чтобы обновить существующий кортеж, вы можете использовать как метод ``update()``, так и метод ``upsert()``." +"Чтобы обновить существующий кортеж, вы можете использовать как метод ``update()``, так и метод ``upsert()``. " "Функция ``update()`` может использоваться для присваивания, " "арифметических операций (если поле числовое), вырезания и вставки фрагментов" " поля, а также для удаления или вставки поля." msgid "" "In this tutorial, the ``update()`` command is used to update the tuple " -"identified by primary key value = ``800``." +"identified by primary key value = ``800``. " "The operation assigns a new value to the second field in the tuple:" msgstr "" "В этом руководстве команда ``update()`` используется для обновления кортежа, " -"определенного значением ключа ``800``." +"определенного значением ключа ``800``. " "Операция присваивает новое значение второму полю в кортеже:" msgid "" @@ -106,14 +106,14 @@ msgid "" msgstr "" "Для функции ``upsert``, если уже существует кортеж, " "который совпадает с ключевыми полями tuple, запрос приведет к тому же " -"результату, что и метод ``update()``. Если нет кортежа, совпадающего с ключевыми полями tuple," -" запрос приведет к тому же результату, что и метод space_object:insert(), +"результату, что и метод ``update()``. Если подходящего кортежа нет," +" запрос приведет к тому же результату, что и метод ``insert()``." msgid "" "To delete a tuple where the key value is ``600``, " "run the ``delete()`` method below:" msgstr "" -"Чтобы удалить кортеж, где значение ключа равно ``600`, " +"Чтобы удалить кортеж, в котором значение ключа равно ``600``, " "запустите метод ``delete()``:" msgid "Then, replace the existing tuple with a new one:" diff --git a/locale/ru/LC_MESSAGES/reference/reference_lua/net_box.po b/locale/ru/LC_MESSAGES/reference/reference_lua/net_box.po index df953112d6..4f3b3ff04e 100644 --- a/locale/ru/LC_MESSAGES/reference/reference_lua/net_box.po +++ b/locale/ru/LC_MESSAGES/reference/reference_lua/net_box.po @@ -18,7 +18,7 @@ msgstr "" "подключение к MySQL, MariaDB или PostgreSQL (см. справочник по :ref:`Модулям" " СУБД SQL `). Другим вариантом, который рассматривается в " "данном разделе, является подключение к экземплярам Tarantool-сервера по " -"сети. Для быстрого знакомства с ``net.box``, вы можете обратиться к разделу" +"сети. Для быстрого знакомства с ``net.box`` вы можете обратиться к разделу" " :ref:`Начало работы с net.box `." msgid "You can call the following methods:"