From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [94.100.177.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 6D377442A00 for ; Fri, 25 Oct 2019 02:28:29 +0300 (MSK) Date: Fri, 25 Oct 2019 02:28:20 +0300 From: Alexander Turenko Message-ID: <20191024232820.cpq4fdxn5kwsj4vg@tkn_work_nb> References: <62cb7773ed9a10682f8804ae214cff1be2fdda77.1571952007.git.v.shpilevoy@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <62cb7773ed9a10682f8804ae214cff1be2fdda77.1571952007.git.v.shpilevoy@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH 1/1] key_def: key_def.new() accept both 'field' and 'fieldno' List-Id: Tarantool development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@freelists.org, tarantool-patches@dev.tarantool.org LGTM. WBR, Alexander Turenko. On Thu, Oct 24, 2019 at 11:21:54PM +0200, Vladislav Shpilevoy wrote: > Closes #4519 > > @TarantoolBot document > Title: key_def.new() accept both 'field' and 'fieldno' > > Before the patch key_def.new() took an index part > array as it is returned in .parts: each > part should include 'type', 'fieldno', and what else > .parts element contains. > > But it was not possible to create a key_def from an > index definition - the array passed to > .create_index() 'parts' argument. Because > key_def.new() didn't recognize 'field' option. That > might be useful, when a key_def is needed on a remote > client, where a space object and its indexes do not > exist. And it would be strange to force a user to > create them just so as he would be able to access > > .space.. > index..parts > > As well as it would be crutchy to make a user manually > replace 'field' with 'fieldno' in its index definition > just to create a key_def. > > Additionally, an ability to pass an index definition > to a key_def constructor makes the API more symmetric. > > Note, that it still is not 100% symmetric, because a > user can't pass field names to the key_def > constructor. A space is needed for that anyway. > --- > Branch: https://github.com/tarantool/tarantool/tree/gerold103/gh-4519-key_def-conform-create_index > Issue: https://github.com/tarantool/tarantool/issues/4519