[tarantool-patches] Re: [PATCH 3/4] schema: allow to set sequence for any index part, not just the first

Konstantin Osipov kostja at tarantool.org
Thu May 16 10:45:29 MSK 2019


* Vladimir Davydov <vdavydov.dev at gmail.com> [19/05/15 14:16]:
> Closes #4009
> 
> @TarantoolBot document
> Title: Sequence can now be set for an index part other than the first
> 
> Initially one could attach a sequence (aka autoincrement) only to the
> first index part. Now it's possible to attach a sequence to any primary
> index part. The part still must be integer though.
> 
> Syntax:
> 
> ```
> box.schema.space.create('test')
> box.space.test:create_index('primary', {
>     parts = {{1, 'string'}, {2, 'unsigned'}, {3, 'unsigned'}},
>     sequence = true, sequence_part = 2
> })
> box.space.test:insert{'a', box.null, 1} -- inserts {'a', 1, 1}


How about allowing column names? We already allow column names in
the parts definition.

Do we really need a separate sequence_part option, why not make
a scalar (bool = true/false, numeric, string - column number or
id).

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32




More information about the Tarantool-patches mailing list