From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 47E162EE78 for ; Thu, 16 May 2019 03:45:31 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eVq49ulSKkrp for ; Thu, 16 May 2019 03:45:31 -0400 (EDT) Received: from smtp44.i.mail.ru (smtp44.i.mail.ru [94.100.177.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 09EB22EE76 for ; Thu, 16 May 2019 03:45:30 -0400 (EDT) Received: by smtp44.i.mail.ru with esmtpa (envelope-from ) id 1hRB4z-0004zG-Ck for tarantool-patches@freelists.org; Thu, 16 May 2019 10:45:29 +0300 Date: Thu, 16 May 2019 10:45:29 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 3/4] schema: allow to set sequence for any index part, not just the first Message-ID: <20190516074529.GJ26670@atlas> References: <924606cabe248b6d1cb8fb126de2c5638537398d.1557916311.git.vdavydov.dev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <924606cabe248b6d1cb8fb126de2c5638537398d.1557916311.git.vdavydov.dev@gmail.com> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org * Vladimir Davydov [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