(
name: string,
body: string,
returnPrefix = '',
declarations = '',
)
| 79 | const channel = TINYBASE + '_' + configHash; |
| 80 | |
| 81 | const createFunction = async ( |
| 82 | name: string, |
| 83 | body: string, |
| 84 | returnPrefix = '', |
| 85 | declarations = '', |
| 86 | ): Promise<string> => { |
| 87 | const escapedFunctionName = escapeIds(TINYBASE, name, configHash); |
| 88 | await executeCommand( |
| 89 | CREATE + |
| 90 | OR_REPLACE + |
| 91 | FUNCTION + |
| 92 | escapedFunctionName + |
| 93 | `()RETURNS ${returnPrefix}trigger ` + |
| 94 | `AS $$ ${declarations}BEGIN ${body}END;$$ LANGUAGE plpgsql;`, |
| 95 | ); |
| 96 | return escapedFunctionName; |
| 97 | }; |
| 98 | |
| 99 | const createTrigger = async ( |
| 100 | prefix: string, |
no test coverage detected
searching dependent graphs…