format(query, values, options) {
        options = assert(options, ['capSQL', 'partial', 'def']);
        const ctf = getCTF(query);
        if (ctf) {
            query = ctf.toPostgres.call(query, query);
        }
        return formatQuery(query, values, false, options);
    }
@method formatting.format
@description
Replaces variables in a string according to the type of `values`:

- Replaces `$1` occurrences when `values` is of type `string`, `boolean`, `number`, `bigint`, `Date`, `Buffer` or when it is `null`.

- Replaces variables `$1`, `$2`, ...`$100000` when `values` is an array of parameters. It throws a {@link external:RangeError RangeError}
when the values or variables are out of range.

- Replaces `$*propName*`, where `*` is any of `{}`, `()`, `[]`, `<>`, `//`, when `values` is an object that's not a
`Date`, `Buffer`, {@link QueryFile} or `null`. Special property name `this` refers to the formatting object itself,
  to be injected as a JSON string. When referencing a property that doesn't exist in the formatting object, it throws
  {@link external:Error Error} = `Property 'PropName' doesn't exist`, unless option `partial` is used.

- Supports $[Nested Named Parameters] of any depth.

By default, each variable is automatically formatted according to its type, unless it is a special variable:

- Raw-text variables end with `:raw` or symbol `^`, and prevent escaping the text. Such variables are not
  allowed to be `null` or `undefined`, or the method will throw {@link external:TypeError TypeError} = `Values null/undefined cannot be used as raw text.`
  - `$1:raw`, `$2:raw`,..., and `$*propName:raw*` (see `*` above)
  - `$1^`, `$2^`,..., and `$*propName^*` (see `*` above)

- Open-value variables end with `:value` or symbol `#`, to be escaped, but not wrapped in quotes. Such variables are
  not allowed to be `null` or `undefined`, or the method will throw {@link external:TypeError TypeError} = `Open values cannot be null or undefined.`
  - `$1:value`, `$2:value`,..., and `$*propName:value*` (see `*` above)
  - `$1#`, `$2#`,..., and `$*propName#*` (see `*` above)

- SQL name variables end with `:name` or symbol `~` (tilde), and provide proper escaping for SQL names/identifiers:
  - `$1:name`, `$2:name`,..., and `$*propName:name*` (see `*` above)
  - `$1~`, `$2~`,..., and `$*propName~*` (see `*` above)

- Modifier `:alias` - non-verbose $[SQL Names] escaping.

- JSON override ends with `:json` to format the value of any type as a JSON string

- CSV override ends with `:csv` or `:list` to format an array as a properly escaped comma-separated list of values.

@param {string|QueryFile|object} query
A query string, a {@link QueryFile} or any object that implements $[Custom Type Formatting], to be formatted according to `values`.

@param {array|object|value} [values]
Formatting parameter(s) / variable value(s).

@param {{}} [options]
Formatting Options.

@param {boolean} [options.capSQL=false]
Formats reserved SQL words capitalized. Presently, this only concerns arrays, to output `ARRAY` when required.

@param {boolean} [options.partial=false]
Indicates that we intend to do only a partial replacement, i.e. throw no error when encountering a variable or
property name that's missing within the formatting parameters.

**NOTE:** This option has no meaning when option `def` is used.

@param {*} [options.def]
Sets default value for every variable that's missing, consequently preventing errors when encountering a variable
or property name that's missing within the formatting parameters.

It can also be set to a function, to be called with two parameters that depend on the type of formatting being used,
and to return the actual default value:

- For $[Named Parameters] formatting:
  - `name` - name of the property missing in the formatting object
  - `obj` - the formatting object, and is the same as `this` context

- For $[Index Variables] formatting:
  - `index` - element's index (starts with 1) that's outside the input array
  - `arr` - the formatting/input array, and is the same as `this` context

  You can tell which type of call it is by checking the type of the first parameter.

@returns {string}
Formatted query string.

The function will throw an error, if any occurs during formatting.