Skip to content
Snippets Groups Projects
Commit 7175f1c8 authored by Mergen Imeev's avatar Mergen Imeev Committed by Kirill Yukhin
Browse files

sql: introduce syntax for MAP values

This patch introduces a new syntax that allows to create MAP values in
an SQL query.

Part of #4763

@TarantoolBot document
Title: Syntax for MAP in SQL

The syntax for creating document values is now available in SQL. You can
use `{`, `:` and `}` to create a MAP value. Only INTEGER, STRING, and
UUID values can be keys in a MAP value. If there are two or more values
for the same key, the last one will be used for that key.

Examples:
```
tarantool> box.execute("SELECT {1 : 'a', 'asd' : 1.5, uuid() : true};")
---
- metadata:
  - name: COLUMN_1
    type: map
  rows:
  - [{1: 'a', 91ca4dbb-c6d4-4468-b4a4-ab1e409dd87e: true, 'asd': 1.5}]
...
```

```
tarantool> box.execute("SELECT {'h' : ['abc', 321], 7 : {'b' : 1.5}};")
---
- metadata:
  - name: COLUMN_1
    type: map
  rows:
  - [{7: {'b': 1.5}, 'h': ['abc', 321]}]
...
```
parent 899fbaeb
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment