Giter Club home page Giter Club logo

Comments (2)

vadim-tropashko avatar vadim-tropashko commented on May 26, 2024

Could you please provide an example where more than one trigger is generated for the same table? In current JS implementation trigger functionality is aggregated under table_name_bui, e.g.

dept /rowversion
    name /lower

which generates

-- create tables

create table dept (
    id             number generated by default on null as identity
                   constraint dept_id_pk primary key,
    name           varchar2(255 char),
    row_version    integer not null
);

-- triggers
create or replace trigger dept_biu
    before insert or update
    on dept
    for each row
begin
    :new.name := lower(:new.name);
    if inserting then
        :new.row_version := 1;
    elsif updating then
        :new.row_version := NVL(:old.row_version, 0) + 1;
    end if;
end dept_biu;
/

-- Generated by Quick SQL...

from quicksql.

RichardSoule avatar RichardSoule commented on May 26, 2024

Vadim,

Yes, the current implementation creates a single trigger. But the trigger that it creates is a ‘classic trigger’ rather than a compound trigger. The name of the trigger has an _biu at the end. This would encourage anyone who wanted logic to after after insert or update to create a second _aiu trigger. What I’m suggesting is we encourage the better behavior of a single trigger for each table, as a compound trigger, with the ‘extra’ spots commented out.

Does that make sense? I tried to communicate that previously, I’m sorry it wasn’t clear.

from quicksql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.