def _build_standard_column_condition(
    field: str, op: str, value: Any, param_helper: ParamHelper
) -> str:  # type: ignore
    """Builds SQL condition for standard (non-array, non-JSONB) columns."""

    # Handle NULL comparisons
    if value is None:
        if op == FilterOperator.EQ:
            return f"{field} IS NULL"
        elif op == FilterOperator.NE:
            return f"{field} IS NOT NULL"
        else:
            # Other operators typically don't make sense with NULL comparison in SQL
            # and often result in NULL (effectively false in WHERE)
            return "FALSE"  # Or raise error? Let's return FALSE.

    # Standard comparisons
    if op == FilterOperator.EQ:
        placeholder = param_helper.add(value)
        return f"{field} = {placeholder}"
    elif op == FilterOperator.NE:
        placeholder = param_helper.add(value)
        return f"{field} != {placeholder}"
    elif op == FilterOperator.GT:
        placeholder = param_helper.add(value)
        return f"{field} > {placeholder}"
    elif op == FilterOperator.GTE:
        placeholder = param_helper.add(value)
        return f"{field} >= {placeholder}"
    elif op == FilterOperator.LT:
        placeholder = param_helper.add(value)
        return f"{field} < {placeholder}"
    elif op == FilterOperator.LTE:
        placeholder = param_helper.add(value)
        return f"{field} <= {placeholder}"

    # String comparisons
    elif op == FilterOperator.LIKE:
        if not isinstance(value, str):
            raise FilterError(
                f"'{FilterOperator.LIKE}' requires a string value for field '{field}'."
            )
        placeholder = param_helper.add(
            value
        )  # Assume user includes wildcards if needed
        return f"{field} LIKE {placeholder}"
    elif op == FilterOperator.ILIKE:
        if not isinstance(value, str):
            raise FilterError(
                f"'{FilterOperator.ILIKE}' requires a string value for field '{field}'."
            )
        placeholder = param_helper.add(
            value
        )  # Assume user includes wildcards if needed
        return f"{field} ILIKE {placeholder}"

    # IN / NOT IN
    elif op == FilterOperator.IN:
        if not isinstance(value, list):
            raise FilterError(
                f"'{FilterOperator.IN}' requires a list value for field '{field}'."
            )
        if not value:
            return "FALSE"  # IN empty list is always false
        placeholders = [param_helper.add(item) for item in value]
        return f"{field} IN ({', '.join(placeholders)})"
    elif op == FilterOperator.NIN:
        if not isinstance(value, list):
            raise FilterError(
                f"'{FilterOperator.NIN}' requires a list value for field '{field}'."
            )
        if not value:
            return "TRUE"  # NOT IN empty list is always true
        placeholders = [param_helper.add(item) for item in value]
        return f"{field} NOT IN ({', '.join(placeholders)})"

    # If we get here, the operator is not supported
    raise FilterError(
        f"Unsupported operator '{op}' for standard column '{field}'."
    )
Builds SQL condition for standard (non-array, non-JSONB) columns.
py/core/providers/database/filters.py