All notable changes to this project are documented here. The format is based on
Keep a Changelog, and this project adheres
to Semantic Versioning. Versions are per
package; this entry covers the cockroachdb, cockroachdb-core, and
cockroachdb-sqlalchemy packages.
Follower reads can now target a specific staleness, and a @follower_read /
SQLAlchemy session helper that raised AttributeError at runtime has been fixed.
hours_ago,minutes_agoandseconds_agokeyword-only parameters on thefollower_read()decorator,FollowerReadContext.scoped(), and the SQLAlchemy sessionfollower_read()helper. They add up and compose toAS OF SYSTEM TIME '-Ns'; with nothing set the read still usesfollower_read_timestamp().cockroachdb.staleness.build_staleness()— the single source of truth for composing + validating a staleness expression. Exported fromcockroachdb.
- SQLAlchemy
session.follower_read()raisedAttributeErrorat runtime. It calledFollowerReadContext.set(...)/reset(...)(methods that do not exist) and passed aboolinto astr | Nonecontextvar. It now uses the realFollowerReadContext.scoped()contextmanager. - A negative
hours_ago/minutes_ago/seconds_agonow raisesValueErrorat call time instead of producing an invalid clause.
MetricsCollector.record_follower_read()is still not wired to any execution path (no call sites library-wide). Recording follower-read metrics requires instrumenting the SQLAlchemy event / psycopg execution layer — tracked separately.