go-pg / pg

Golang ORM with focus on PostgreSQL features and performance
https://pg.uptrace.dev/
BSD 2-Clause "Simplified" License
5.65k stars 401 forks source link

Fix hook #1946

Closed oligot closed 2 years ago

oligot commented 2 years ago

With the current version, I have those errors when trying to use the hook:

cannot use pgdebug.DebugHook{...} (type pgdebug.DebugHook) as type pg.QueryHook in argument to db.baseDB.AddQueryHook:
pgdebug.DebugHook does not implement pg.QueryHook (BeforeQuery method has pointer receiver)
cannot use pgotel.TracingHook{} (type pgotel.TracingHook) as type pg.QueryHook in argument to db.baseDB.AddQueryHook:
pgotel.TracingHook does not implement pg.QueryHook (AfterQuery method has pointer receiver)
oligot commented 2 years ago

My bad, I wasn't using the NewxxxHook (NewDebugHook and NewTracingHook) methods.