I am using Babashka to local SQL comments of a certain form, then using EVAL on the contents to get string content to replace the comments with.
a function that has proven incredibly fucking useful for my use cases:
(defn
immutable-column
[schema table column]
(format
"
create function %s.%s_%s_tr_bu_fn()
returns trigger
as $$
begin
if old.%s is distinct from new.%s
then
raise exception '`%s` was updated.';
end if;
Comment too long. Click here to view the full text.