bricks
bricks copied to clipboard
Upgrade go-pg dependency
Problem
We are currently using github.com/go-pg/pg v6.14.5 which might be outdated.
As far as I can tell the only impact this has on us is a performance one. When using the Exists() method on a query (e.g. db.Model(&m).Where(...).Exists()) go-pg performs a regular select and checks whether the number of rows returned. This is far from efficient.
Suggested solution
Upgrade to a newer version, like v8.0.4 where this seems to be fixed.
Changelog of v.8.0.4. Upgrading needs adjustments in our code:
DB.OnQueryProcessed is replaced with DB.AddQueryHook
The format of the hook changes also.
If the impact of this upgrade is too huge, we can live with or work around the problem mentioned. But we probably have to upgrade eventually.
Bump. Ran into the same problem when creating a new microservice with pace bricks. I think this would be beneficial.