tarantool / tarantool/tarantool

Add action_timing to _trigger space

Open
#4,140 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature sql
Dominant language
Lua
Stars
3.7k
Forks
419
Avg merge
1d 23h
Merged PRs (30d)
88

Description

This is due to a suggestion from Konstantin Osipov:
"

  1. a feature request to extend _trigger system space with trigger
    timing - this should take a bit longer, yet we need to do it in
    2.2.
    "

The context was a mention of a column in information_schema.triggers
named ACTION_TIMING, which can be 'BEFORE' or 'AFTER' or 'INSTEAD OF'.
So add a field in the _trigger space containing one of those
values, depending on the way that CREATE TRIGGER was done.

I hope this feature request isn't due to a misunderstanding.
I mentioned that information_schema.triggers.ACTION_TIMING
can be hard to find by looking at the _trigger space.
But it is only one of several bits of information.
Therefore I suggested I would like a list of tokens.
That is, if I could say:
gimme_tokens([[box.execute([[create trigger before /* before */ After/before/INSERT ON t
FOR EACH ROW BEGIN DELETE FROM before; end;]])
then I could find ACTION_TIMING (which = 'AFTER' in this example),
and EVENT_MANIPULATION (= 'INSERT'), and EVENT_OBJECT_TABLE (= 'T').
For simulating information_schema, action_timing is not good enough.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the _trigger space and the CREATE TRIGGER handling described in the issue, then compare the available metadata with information_schema.triggers.ACTION_TIMING. Done means the _trigger space exposes whether each trigger was created as BEFORE, AFTER, or INSTEAD OF.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
database
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.