function schemas(connection) {
    if (!connection.database || connection.database === '') {
        const columnnames = ['table_name', 'column_name', 'data_type'];
        const rows = [];
        return {columnnames, rows};
    }

    const client = pool.getClient(connection);

    return client
        .dataset(connection.database)
        .getTables()
        .then(results => {
            const metadataPromises = results[0].map(table => table.getMetadata());
            return Promise.all(metadataPromises);
        }).
        then(results => {
            const columnnames = ['table_name', 'column_name', 'data_type'];
            const rows = [];

            // iterate tables
            results.forEach(result => {
                const metadata = result[0];
                const tableName = metadata.tableReference.tableId;

                // iterate fields
                if (metadata.schema && metadata.schema.fields)
                {
                    metadata.schema.fields.forEach(({name, type}) => {
                        rows.push([tableName, name, type]);
                    });
                }
            });

            return {columnnames, rows};
        });
}
Should return a list of tables and their columns that are defined within the database.
@param {object} connection - Connection parameters
@param {string} connection.projectId - Google Cloud Project Id
@param {string} connection.database - Google Big Query Database
@param {string} connection.keyFilename - Google Service Account Key File
@returns {Promise} that resolves to { columnnames, rows }