MCPcopy Index your code
hub / github.com/tinyplex/tinybase / createTrigger

Function createTrigger

src/persisters/common/database/postgresql.ts:99–117  ·  view source on GitHub ↗
(
    prefix: string,
    escapedTriggerName: string,
    body: string,
    escapedFunctionName: string,
  )

Source from the content-addressed store, hash-verified

97 };
98
99 const createTrigger = async (
100 prefix: string,
101 escapedTriggerName: string,
102 body: string,
103 escapedFunctionName: string,
104 ): Promise<string> => {
105 await executeCommand(
106 CREATE +
107 prefix +
108 'TRIGGER' +
109 escapedTriggerName +
110 body +
111 'EXECUTE ' +
112 FUNCTION +
113 escapedFunctionName +
114 `()`,
115 );
116 return escapedTriggerName;
117 };
118
119 const notify = (message: string) =>
120 `PERFORM pg_notify('${channel}',${message});`;

Callers 2

addDataChangedTriggersFunction · 0.85
addPersisterListenerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…