providers/database/sql-client.js
function all(tableName, fieldNames, where, orderBy, limit = null, join = null) {
    if (orderBy && !checkOrderBy(orderBy)) {
      throw new Error('Invalid arg: orderBy');
    }

    if (!db) {
      throw new Error('Not connected');
    }
    let sql = `SELECT ${fieldNames.join(',')} FROM ${tableName}`;
    if (join) {
      sql += ` JOIN ${join}`;
    }
    if (where) {
      sql += ` WHERE ${where}`;
    }
    if (orderBy) {
      sql += ` ORDER BY ${orderBy.join(',')}`;
    }
    if (limit) {
      sql += ` LIMIT ${limit}`;
    }
    return new Promise(((resolve, reject) => {
      db.all(sql, [], (error, rows) => {
        if (error) {
          reject(error);
        } else {
          resolve(rows);
        }
      });
    }));
  }
function all(tableName, fieldNames, where, orderBy, limit = null, join = null) {
    if (orderBy && !checkOrderBy(orderBy)) {
      throw new Error('Invalid arg: orderBy');
    }

    if (!db) {
      throw new Error('Not connected');
    }
    let sql = `SELECT ${fieldNames.join(',')} FROM ${tableName}`;
    if (join) {
      sql += ` JOIN ${join}`;
    }
    if (where) {
      sql += ` WHERE ${where}`;
    }
    if (orderBy) {
      sql += ` ORDER BY ${orderBy.join(',')}`;
    }
    if (limit) {
      sql += ` LIMIT ${limit}`;
    }
    return new Promise(((resolve, reject) => {
      db.all(sql, [], (error, rows) => {
        if (error) {
          reject(error);
        } else {
          resolve(rows);
        }
      });
    }));
  }
function all ( tableName , fieldNames , where , orderBy , limit = null , join = null ) { if ( orderBy && ! checkOrderBy ( orderBy ) ) { throw new Error ( 'Invalid arg: orderBy' ) ; } if ( ! db ) { throw new Error ( 'Not connected' ) ; } let sql = ` ${ fieldNames . join ( ',' ) } ${ tableName } ` ; if ( join ) { sql += ` ${ join } ` ; } if ( where ) { sql += ` ${ where } ` ; } if ( orderBy ) { sql += ` ${ orderBy . join ( ',' ) } ` ; } if ( limit ) { sql += ` ${ limit } ` ; } return new Promise ( ( ( resolve , reject ) => { db . all ( sql , [ ] , ( error , rows ) => { if ( error ) { reject ( error ) ; } else { resolve ( rows ) ; } } ) ; } ) ) ; }
return all rows
return all rows