Documentation
¶
Overview ¶
Package queryscope provides the primitive that wrappers use to push a per-call SQL constraint onto the request context for inner stores to consume. The configstore and logstore packages both import it so the same QueryScope mechanism powers their ScopedDB read paths without introducing a cycle between the two stores.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithQueryScope ¶
func WithQueryScope(ctx context.Context, scope QueryScope) context.Context
WithQueryScope returns ctx carrying scope. Nil scope is a no-op.
Types ¶
type QueryScope ¶
QueryScope mutates a query to enforce caller-driven row-level constraints. Set on ctx by an upstream wrapper; inner store query helpers apply it blindly via ScopedDB.
func FromContext ¶
func FromContext(ctx context.Context) QueryScope
FromContext returns the scope stashed on ctx, or nil when no scope is present (background jobs, OSS-only deployments, internal lookups that bypassed the wrapper). A nil scope is equivalent to "no restriction": query builders apply no WHERE clause.