Skip to content

Commit 4bb378e

Browse files
committed
Fixes gh-1054 _session_settings system space
1 parent 874d557 commit 4bb378e

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

doc/book/box/box_space.rst

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,10 @@ Below is a list of all ``box.space`` functions and members.
162162
| :ref:`box.space._vcollation | (Metadata) List of collations |
163163
| <box_space-vcollation>` | accessible for the current user |
164164
+----------------------------------------------+---------------------------------+
165-
165+
| :ref:`box.space._session_settings | (Metadata) List of settings |
166+
| <box_space-session_settings>` | affecting behavior of the |
167+
| | current session |
168+
+----------------------------------------------+---------------------------------+
166169

167170
.. module:: box.space
168171

@@ -2716,6 +2719,33 @@ organizing:
27162719
of its tuples is identical to that of :ref:`box.space._collation <box_space-collation>`, but
27172720
permissions for certain tuples are limited in accordance with user privileges.
27182721

2722+
.. _box_space-session_settings:
2723+
2724+
.. data:: _session_settings
2725+
2726+
``_session_settings`` is a temporary system space with a list of settings that
2727+
may affect behavior, particularly SQL behavior, for the current session.
2728+
It uses a special engine named 'service'.
2729+
Every 'service' tuple is created on the fly, that is, new tuples are made every time ``_session_settings`` is accessed.
2730+
Every settings tuple has two fields: ``name`` (the primary key) and ``value``.
2731+
The tuples' names and default values are: |br|
2732+
``sql_default_engine``: default :ref:`storage engine <engines-chapter>` for new SQL tables. Default = 'memtx'. |br|
2733+
``sql_defer_foreign_keys``: whether foreign-key checks can wait till commit. Default = false. |br|
2734+
``sql_full_column_names``: no effect at this time. Default = false. |br|
2735+
``sql_full_metadata``: whether SQL result metadata will have more than just name and type. Default = false. |br|
2736+
``sql_parser_debug``: whether to show parser steps for following statements. Default = false. |br|
2737+
``sql_recursive_triggers``: whether a triggered statement can activate a :ref:`trigger <sql_create_trigger>`. Default = true. |br|
2738+
``sql_reverse_unordered_selects``: whether result rows are usually in reverse order if there is no :ref:`ORDER BY clause <sql_order_by>`. Default = false. |br|
2739+
``sql_select_debug``: whether to show execution steps during :ref:`SELECT <sql_select>`. Default = false. |br|
2740+
``sql_vdbe_debug``: for use by Tarantool's developers. Default = false. |br|
2741+
Three requests are possible: :ref:`select <box_space-select>` and :ref:`get <box_space-get>` and :ref:`update <box_space-update>`.
2742+
For example, after ``s = box.space._session_settings``,
2743+
``s:select('sql_default_engine')`` probably returns ``{'sql_default_engine', 'memtx'}``, and
2744+
``s:update('sql_default_engine', {{'=', 'value', 'vinyl'}})`` changes the default engine to 'vinyl'. |br|
2745+
Updating ``sql_parser_debug`` or ``sql_select_debug`` or ``sql_vdbe_debug`` has no effect unless
2746+
Tarantool was built with -DCMAKE_BUILD_TYPE=Debug. To check if this is so, look at
2747+
``require('tarantool').build.target``.
2748+
27192749
.. _box_space-operations-detailed-examples:
27202750

27212751
===============================================================================

0 commit comments

Comments
 (0)