function enumSql(dir, options, cb) {
    if (!npm.utils.isText(dir)) {
        throw new TypeError('Parameter \'dir\' must be a non-empty text string.');
    }
    options = assert(options, ['recursive', 'ignoreErrors']);
    cb = (typeof cb === 'function') ? cb : null;
    return _enumSql(dir, options, cb, '');
}
@method utils.enumSql
@description
Synchronously enumerates all SQL files (within a given directory) into a camelized SQL tree.

All property names within the tree are camelized via {@link utils.camelizeVar camelizeVar},
so they can be used in the code directly, as open property names.

@param {string} dir
Directory path where SQL files are located, either absolute or relative to the current directory.

SQL files are identified by using `.sql` extension (case-insensitive).

@param {{}} [options]
Search options.

@param {boolean} [options.recursive=false]
Include sub-directories into the search.

Sub-directories without SQL files will be skipped from the result.

@param {boolean} [options.ignoreErrors=false]
Ignore the following types of errors:
- access errors, when there is no read access to a file or folder
- empty or duplicate camelized property names

This flag does not affect errors related to invalid input parameters, or if you pass in a
non-existing directory.

@param {function} [cb]
A callback function that takes three arguments:
- `file` - SQL file path, relative or absolute, according to how you specified the search directory
- `name` - name of the property that represents the SQL file
- `path` - property resolution path (full property name)

If the function returns anything other than `undefined`, it overrides the corresponding property value in the tree.

@returns {object}
Camelized SQL tree object, with each value being an SQL file path (unless changed via the callback).

@example

// simple SQL tree generation for further processing:
const tree = pgp.utils.enumSql('../sql', {recursive: true});

@example

// generating an SQL tree for dynamic use of names:
const sql = pgp.utils.enumSql(__dirname, {recursive: true}, file => {
    return new pgp.QueryFile(file, {minify: true});
});

@example

const {join: joinPath} = require('path');

// replacing each relative path in the tree with a full one:
const tree = pgp.utils.enumSql('../sql', {recursive: true}, file => {
    return joinPath(__dirname, file);
});