question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add trigger functionality

See original GitHub issue

We can add basic functionality to allow users to create thier own triggers, for example:

@Trigger({
    name: "lalala",
    fires: "after",
    insert: true,
    update: true
})
export class UserDateUpdater {

    getSql() {
        return `
BEGIN
	...
END
`;
    }

}

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:85
  • Comments:22 (5 by maintainers)

github_iconTop GitHub Comments

38reactions
Murillo2380commented, Apr 1, 2020

Maybe it is not needed, I believe you can use listeners and subscribers

26reactions
patrickmichalinacommented, May 23, 2020

Will this be consider if I were to write it? I have some helper functions that create DB triggers in Postgres during migrations but it would be much nicer if this were automated within migrations ecosystem.

Typerom app level subscribers are NOT the same as DB triggers and functions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation: 15: CREATE TRIGGER - PostgreSQL
CREATE TRIGGER creates a new trigger. CREATE OR REPLACE TRIGGER will either create a new trigger, or replace an existing trigger. The trigger...
Read more >
CREATE TRIGGER (Transact-SQL) - Microsoft Learn
Creates a DML, DDL, or logon trigger. A trigger is a special type of stored procedure that automatically runs when an event occurs...
Read more >
SQL Server CREATE TRIGGER
The CREATE TRIGGER statement allows you to create a new trigger that is fired automatically whenever an event such as INSERT , DELETE...
Read more >
13 Using Database Triggers
INSTEAD OF triggers provide a transparent way of modifying views that cannot be modified directly through UPDATE, INSERT, and DELETE statements. These triggers...
Read more >
CREATE TRIGGER statement - IBM
The CREATE TRIGGER statement defines a trigger in the database. Triggers can be created to support general forms of integrity or business rules....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found