Skip to main content

psql_escape

Replace chars not fit for use in search queries with a single space.

def psql_escape(
query: string
) - > string

Replace chars not fit for use in search queries with a single space.

Parameters

NameTypeDescription
querystringThe raw search query string containing potential special characters that need to be escaped or removed for PostgreSQL compatibility.

Returns

TypeDescription
stringThe sanitized query string with special characters replaced by spaces and whitespace normalized.