You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
first thanks for the wonderful library. I got an issue with the code generated for a procedure.
xo generated following code for my procedure. My DB is PostgreSQL 14
Procedure
create function update_updated_at_column() returns trigger
language plpgsql
as
$$
BEGIN
NEW.updated_at= now();
RETURN NEW;
END;
$$;
alter function update_updated_at_column() owner to abhishek;
Generated go code:
package xodb
// Code generated by xo. DO NOT EDIT.import (
"context"
)
// UpdateUpdatedAtColumn calls the stored function 'public.update_updated_at_column() trigger' on db.funcUpdateUpdatedAtColumn(ctx context.Context, dbDB) (Trigger, error) {
// call public.update_updated_at_columnconstsqlstr=`SELECT * FROM public.update_updated_at_column()`// runvarr0Triggerlogf(sqlstr)
iferr:=db.QueryRowContext(ctx, sqlstr).Scan(&r0); err!=nil {
returnTrigger{}, logerror(err)
}
returnr0, nil
}
If you see the Trigger structure is not generated and the code fails to compile. I think it is a bug in code generation but can not figure out in the templates. Please help.
Thanks & Regards,
Abhi
The text was updated successfully, but these errors were encountered:
first thanks for the wonderful library. I got an issue with the code generated for a procedure.
xo generated following code for my procedure. My DB is PostgreSQL 14
Procedure
Generated go code:
If you see the Trigger structure is not generated and the code fails to compile. I think it is a bug in code generation but can not figure out in the templates. Please help.
Thanks & Regards,
Abhi
The text was updated successfully, but these errors were encountered: