neosqlite.collection.pipeline_context module

PipelineContext — tracks field state across aggregation pipeline stages.

Extracted from sql_tier_aggregator.py for reuse and testability.

class neosqlite.collection.pipeline_context.PipelineContext[source]

Bases: object

Tracks field aliases, computed fields, and document state across pipeline stages.

__init__() None[source]

Initialize pipeline context with default state.

add_computed_field(field: str, sql_expr: str) None[source]

Track a computed field.

remove_field(field: str) None[source]

Mark field as removed.

get_field_sql(field: str) str | None[source]

Get SQL expression for a field.

is_field_available(field: str) bool[source]

Check if field is available in current context.

is_field_computed(field: str) bool[source]

Check if field is a computed field.

preserve_root() None[source]

Mark that $$ROOT should be preserved.

needs_root() bool[source]

Check if $$ROOT is needed.

clone() PipelineContext[source]

Create a copy of this context.