SQL API
SQLEntity
Bases: EntityVisibility, SQLModel, HasOrm[Mapped[Any]], Entitieable[IDT], Generic[IDT]
SQLEntityStream
Bases: SimpleAsyncEntityStream[E], AsyncEntityStream[E], SQLDataBackend
Entity stream backed by a SQLAlchemy Select.
Operations that SQL can express are pushed down into the statement (take → LIMIT, drop → OFFSET, sort by field → ORDER BY, distinct, count, first, column projection via to_values). Everything else (Python predicates/mappers) falls back to the in-memory stream over a server-side cursor — rows are never fully buffered.
SQLQuery
dataclass
SQLValueStream
Bases: SimpleAsyncValueStream[T], AsyncValueStream[T], SQLDataBackend
Single-column stream backed by a SQLAlchemy Select.
Pushes down take/drop/distinct/sort and the aggregate terminals (count, sum, min, max) into SQL; Python callables fall back to the in-memory stream over a server-side cursor.