Skip to main content

quote_lexeme

Quotes and escapes a string value for use as a lexeme in a PostgreSQL text search query by applying SQL escaping and UTF-8 encoding.

def quote_lexeme(
value: any
) - > string

Escapes and quotes a string value for use as a lexeme in PostgreSQL full-text search queries.

Parameters

NameTypeDescription
valueanyThe raw input value to be transformed into a valid PostgreSQL search lexeme.

Returns

TypeDescription
stringThe safely escaped and quoted lexeme string, decoded into a standard UTF-8 string format.