Add trigger functionality
See original GitHub issueWe 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:
- Created 6 years ago
- Reactions:85
- Comments:22 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Maybe it is not needed, I believe you can use listeners and subscribers
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.