2021-10-22 14:11:03 +00:00
|
|
|
DROP FUNCTION IF EXISTS <%- schema %>.<%- name %>;
|
2020-11-14 01:38:56 +00:00
|
|
|
DELIMITER $$
|
2022-12-29 13:27:16 +00:00
|
|
|
CREATE DEFINER=<%- definer %> FUNCTION <%- schema %>.<%- name %>(<%- locals.paramList %>)
|
2022-02-07 14:43:12 +00:00
|
|
|
RETURNS <%- returns %><%
|
2022-12-29 13:27:16 +00:00
|
|
|
if (locals.isDeterministic == 'NO') { %>
|
2022-02-07 14:43:12 +00:00
|
|
|
NOT DETERMINISTIC<%
|
|
|
|
} else { %>
|
|
|
|
DETERMINISTIC<%
|
|
|
|
}
|
2022-12-29 13:27:16 +00:00
|
|
|
if (locals.dataAccess) { %>
|
2022-02-07 14:43:12 +00:00
|
|
|
<%- dataAccess %><%
|
|
|
|
}
|
2022-12-29 13:27:16 +00:00
|
|
|
if (locals.securityType == 'INVOKER') { %>
|
2022-02-07 14:43:12 +00:00
|
|
|
SQL SECURITY <%- securityType %><%
|
|
|
|
}
|
2022-12-29 13:27:16 +00:00
|
|
|
if (locals.comment) { %>
|
2022-02-07 14:43:12 +00:00
|
|
|
COMMENT <%- comment %><%
|
|
|
|
} %>
|
2020-11-14 01:38:56 +00:00
|
|
|
<%- body %>$$
|
|
|
|
DELIMITER ;
|