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

SQLAlchemySearchBackend

Translates SearchSpec to SQLAlchemy ILIKE clauses.

Module Contents

class pypaginate.adapters.sqlalchemy.search.SQLAlchemySearchBackend

Translates SearchSpec to SQLAlchemy ILIKE clauses.

Satisfies SearchBackend protocol. Tokenizes the query and matches each token against all specified fields.

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.