persistence/predicate.py

EverOS · src/everos/infra/persistence/predicate.py · python · Apache-2.0
database, tag:embed-classified

Provides a backend‑neutral predicate tree for building query filters in a storage‑agnostic way.

# Source: https://github.com/EverMind-AI/EverOS | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""Backend-neutral predicate tree for rebuildable derived indexes.

Application and memory code construct these nodes.  A storage adapter owns
the rendering into its physical query language, so backend syntax never leaks
above :mod:`everos.infra.persistence`.
"""

from __future__ import annotations

import datetime as dt
from dataclasses import dataclass
from typing import Literal

type Scalar = str | int | float | bool | dt.datetime
type ComparisonOperator = Literal["eq", "ne", "gt", "gte", "lt", "lte"]


class Predicate:
    """Marker base class for derived-index predicates."""


@data

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key