Releases: Stumble/sqlc
Releases · Stumble/sqlc
v2.1.4
v2.1.3
Rebase upstream
v2.1.2 re-gen needle example
BREAKING: Queries struct stop using interface for cache.
DCache upgraded to return *DCache instead of the Cache
interface in its New() function at some point. Since then,
User might pass a pointer of (nil)(*dcache.DCache) to Queries,
which is not a nil interface but an interface holding an nil
poitner. This makes the internal nil check failed to catch.
There are many solutions:
- Keep it like this, and user must be careful not to pass nil pointer.
Because go is not null-safe, there is no compilation-time check for
this. Then if unit-test coverage is low, user will run into this issue
on production, and panic. - DCache returns interface: no not supported. Besides it may still have
the above issue, just unlikely. - Abandon cache interface, use concrete struct. The tradeoff is that
we can no longer inject other cache implementation, whichi might be
a useful feature during testings. However, I have never seen this
in real life so it might be YAGNI.
So we choosed (3) as the final solution.
Use hash as cache key if too long.
Misc fix. 1. stricter check to prohibit invalidate query with pointer field args. 2. fix missing ':' for single param query invalidation.