pypaginate.adapters.sqlalchemy.search
SQLAlchemy search backend translating SearchSpec to ILIKE clauses.
Combines field conditions with OR (any field matches) and token conditions with AND (all tokens must match).
Classes
Translates SearchSpec to SQLAlchemy ILIKE clauses. |
Module Contents
- class pypaginate.adapters.sqlalchemy.search.SQLAlchemySearchBackend
Translates SearchSpec to SQLAlchemy ILIKE clauses.
Satisfies
SearchBackendprotocol. Tokenizes the query and matches each token against all specified fields.- static apply_search(query: object, spec: pypaginate.domain.specs.SearchSpec) object
Apply a search spec to a SQLAlchemy Select.
- Parameters:
query – A SQLAlchemy Select statement.
spec – Search specification with query and fields.
- Returns:
Modified Select with WHERE clauses for search.