Skip to content

Multiple tables #2

@semiton

Description

@semiton

Please add the ability to specify multiple tables.
Sample:

    this.get = function(tableName, responseCallback) {
        if (typeof tableName.push === 'function') {
            for (var i = 0; i < tableName.length; i++) {
                if (typeof tableName[i] === 'string') {
                    tableName[i] = escapeFieldName(tableName[i]);
                } else {
                    tableName.splice(i,1);
                }
            }
            tableName = tableName.join(',');
        }
        if (typeof tableName === 'string') {
            var combinedQueryString = 'SELECT ' + (selectClause.length === 0 ? '*' : selectClause.join(','))
            + ' FROM ' + tableName
            + buildJoinString()
            + buildDataString(whereClause, ' AND ', 'WHERE')
            + (orderByClause !== '' ? ' ORDER BY ' + orderByClause : '')
            + (limitClause !== -1 ? ' LIMIT ' + limitClause : '')
            + (offsetClause !== -1 ? ' OFFSET ' + offsetClause : '');

            connection.query(combinedQueryString, responseCallback);
            resetQuery(combinedQueryString);
        }

        return that;
    };

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions