@classmethod
def _adapt_text_array(cls, v):
    """Adapt a text type array parameter."""
    if isinstance(v, list):
        adapt = cls._adapt_text_array
        return '{%s}' % ','.join(adapt(v) for v in v)
    if v is None:
        return 'null'
    if not v:
        return '""'
    v = str(v)
    if cls._re_array_quote.search(v):
        v = '"%s"' % cls._re_array_escape.sub('\\\\\\1', v)
    return v
