When querying a citext column against some literal values I get the error Don't know how to literal-quote value '$LITERAL_VALUE'. It seems that a literal_processor method is missing on the CIText, class. When adding the below method everything works, is there a reason why this isn't defined in the class?
# This is copied from the `literal_processor` of sqlalchemy's own
# `String` type.
def literal_processor(self, dialect: t.Any) -> t.Callable[[str], str]:
def process(value: str) -> str:
value = value.replace("'", "''")
if dialect.identifier_preparer._double_percents:
value = value.replace("%", "%%")
return "'%s'" % value
return process
When querying a
citext
column against some literal values I get the errorDon't know how to literal-quote value '$LITERAL_VALUE'
. It seems that aliteral_processor
method is missing on theCIText
, class. When adding the below method everything works, is there a reason why this isn't defined in the class?