text(value, raw) {
        value = resolveFunc(value);
        if (isNull(value)) {
            throwIfRaw(raw);
            return 'null';
        }
        if (typeof value !== 'string') {
            value = value.toString();
        }
        return $to.text(value, raw);
    }
@method formatting.text
@description
Converts a value into PostgreSQL text presentation, escaped as required.

Escaping the result means:
 1. Every single-quote (apostrophe) is replaced with two
 2. The resulting text is wrapped in apostrophes

@param {value|function} value
Value to be converted, or a function that returns the value.

If the `value` resolves as `null` or `undefined`, while `raw`=`true`,
it will throw {@link external:TypeError TypeError} = `Values null/undefined cannot be used as raw text.`

@param {boolean} [raw=false]
Indicates when not to escape the resulting text.

@returns {string}

- `null` string, if the `value` resolves as `null` or `undefined`
- escaped result of `value.toString()`, if the `value` isn't a string
- escaped string version, if `value` is a string.

 The result is not escaped, if `raw` was passed in as `true`.