Golang go-pg v10 AfterQuery with pointer receiver

260 views Asked by At

I am updating my project's dependency for https://github.com/go-pg/pg from v8 to v10 and encounter this problem

in v8 I have AfterQuery function like this:

func (p *PaymentMethod) AfterQuery(c context.Context, db orm.DB) error

and it working properly, after running the query the function is called.

Then I update go-pg to v10 and change the function into this:

func (p *PaymentMethod) AfterQuery(c context.Context, q *pg.QueryEvent) error

and after running the query, the function is not called at all

I am really sure that is the correct syntax as stated in the documentation

Maybe I need to add more function or anything else?

0

There are 0 answers