neosqlite.collection.expr_evaluator.sql_converters.core module

SQL converters for core operators.

class neosqlite.collection.expr_evaluator.sql_converters.core.CoreMixin[source]

Bases: BaseSqlMixin

$expr dispatch, operand-to-SQL conversion, operator mapping.

_convert_expr_to_sql(expr: dict[str, Any]) tuple[str, list[Any]][source]

Convert a $expr expression to SQL.

Parameters:

expr – Expression dictionary

Returns:

Tuple of (SQL expression, parameters)

Raises:
  • NotImplementedError – If operator is not supported in SQL

  • ValueError – If expression structure is invalid

_convert_operand_to_sql(operand: Any) tuple[str, list[Any]][source]

Convert an operand to SQL expression.

Handles: - Field references: “$field” → json_extract/jsonb_extract expression - Literals: numbers, strings, booleans - Nested expressions: {“$operator”: […]}

_map_comparison_operator(op: str) str[source]

Map MongoDB comparison operators to SQL.

_map_arithmetic_operator(op: str) str[source]

Map MongoDB arithmetic operators to SQL.