From: Chris Sosnin <k.sosnin@tarantool.org> To: Peter Gulutzan <pgulutzan@ocelot.ca> Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH 0/4] session settings fixes Date: Tue, 7 Apr 2020 19:32:16 +0300 [thread overview] Message-ID: <1433D33E-327F-4365-BB52-8BB9C6B539D5@tarantool.org> (raw) In-Reply-To: <8dc7be67-fc78-dd42-0634-83692259f0a5@ocelot.ca> Hi! > On 3 Apr 2020, at 20:09, Peter Gulutzan <pgulutzan@ocelot.ca> wrote: > > Hi, > > Re: > SETTING SET "sql_default_engine" = 'memtx'; > > Adding a new reserved word SETTING, without advance notice, > should be against policy. It causes a slight risk > of breaking an existing application. > > I had hoped for > UPDATE _SETTINGS_DEFAULT_ENGINE SET VALUE = 'memtx'; Implementing this syntax would either require creating a table for each setting or adding new keywords, since this is the same as updating tables. Moreover, SET VALUE construction also is not supported, so we still need to reserve a new word. We can borrow another MySQL syntax — SET SESSION name = value What do you think about this option? > I claim that is just as "user friendly" -- it > adds two words, but it removes quotation marks. > And it does not require that users learn new syntax > because UPDATE ... SET is well known. > > Notice that I can already do this -- almost. > This is legal: > CREATE VIEW _SETTINGS_DEFAULT_ENGINE AS > SELECT "value" AS value > FROM "_session_settings" > WHERE "name" = 'sql_default_engine'; > The flaw is that views are not updatable. > But I don't regard that as a big problem > because this is not a proposal to make > all views updatable. It only requires: > when you see that exact UPDATE statement, > transform it to box.session._settings:update. > And similarly for sql_defer_foreign_keys etc. > > Alternatively, users could create a Lua function > X which updates > _session_settings, vaguely like this > box.schema.func.create('X', > {language = 'LUA', > returns = 'string', > body = [[function () > box.space._session_settings:update('sql_default_engine', {{'=', 2, 'memtx'}}); > return 'memtx changed' > end]], > is_sandboxed = false, > exports = {'LUA', 'SQL'}, > is_deterministic = true}) > then allow this SQL syntax: > CALL X(); > Again, I claim that this is just as "user friendly" > because -- as far as I can tell -- some people think > saving keystrokes is the same as being friendly. > Nikita Pettik explained that issue#4711 is for a shortcut > and that is short. > Eventually we will probably want to support CALL anyway, > and it is already a reserved word. > > Thus there are "user-friendly" alternatives that do not > require new proprietary syntax. > > Peter Gulutzan >
next prev parent reply other threads:[~2020-04-07 16:32 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-04-03 17:09 Peter Gulutzan 2020-04-03 18:11 ` Timur Safin 2020-04-07 16:32 ` Chris Sosnin [this message] 2020-04-08 9:40 ` Timur Safin 2020-04-08 15:03 ` Peter Gulutzan 2020-04-08 14:36 ` Peter Gulutzan -- strict thread matches above, loose matches on Subject: below -- 2020-03-30 9:13 Chris Sosnin 2020-04-02 9:14 ` Timur Safin 2020-04-02 10:18 ` Chris Sosnin 2020-04-03 12:47 ` Nikita Pettik 2020-04-03 13:09 ` Nikita Pettik 2020-04-03 14:02 ` Chris Sosnin 2020-04-13 14:18 ` Kirill Yukhin
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1433D33E-327F-4365-BB52-8BB9C6B539D5@tarantool.org \ --to=k.sosnin@tarantool.org \ --cc=pgulutzan@ocelot.ca \ --cc=tarantool-patches@dev.tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 0/4] session settings fixes' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox