<%= @function_spec %>
def <%= @function_name %>(<%= @routine_function_params %><%= if @routine_function_params == [], do: "", else: ", " %>query_opts \\ []) do
	Logger.debug("Calling stored procedure", procedure: "<%= @routine.name %>")

	query(
		"<%= if @routine_has_return_type do %>select * from<% else %>call<% end %> <%= @routine.schema %>.<%= @routine.name %>(<%= @sql_params %>)",
		<%= @sql_query_params %>,
		query_opts
	)
	<%= if @routine_has_return_type do %>
	|> <%= @parse_function_name %>()
	<% else %>
	:ok
	<% end %>
end
