From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 29 Mar 2018 13:54:46 +0300 From: Vladimir Davydov Subject: Re: [PATCH 0/2] schema: expose space_mt and index_mt on table Message-ID: <20180329105446.v427bzpwichq5ntb@esperanza> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: To: Vladislav Shpilevoy , Konstantin Osipov Cc: tarantool-patches@freelists.org List-ID: On Fri, Mar 23, 2018 at 04:07:07PM +0300, Vladislav Shpilevoy wrote: > Branch: http://github.com/tarantool/tarantool/tree/pr-3204-expose-space-index-mt > Issue: https://github.com/tarantool/tarantool/issues/3204 > > Some of users want to extend space and index methods with their > own, but do not want to do it for each space, because a metatable > are created individually for a space. I don't understand why anyone would do that. If one wants to implement some extra methods, they can always create a wrapper in Lua. Overwriting a metatable for this looks like a dirty hack. Anyway, the patch is nearly impossible to review, because it is basically a 100% diff. If you still think it's useful and really want it to get reviewed, please split it properly: first move index_mt and space_mt definitions from box.schema.space.bless without introducing any functional changes, then export them. > > Move these metatables to box.schema, and lookup into them, when > a method was not found in an original metatable. > > Vladislav Shpilevoy (1): > schema: review fixes for box.schema.space/index metatables > > aleclarson (1): > schema: expose space_mt and index_mt on `box.schema` table > > src/box/lua/schema.lua | 631 ++++++++++++++++++++-------------------- > test/box-tap/schema_mt.test.lua | 79 +++++ > 2 files changed, 391 insertions(+), 319 deletions(-) > create mode 100755 test/box-tap/schema_mt.test.lua