providers/database/sql-client.js
function get(tableName, fieldNames, where, orderBy) {
    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 (where) {
      sql += ` WHERE ${where}`;
    }
    if (orderBy) {
      sql += ` ORDER BY ${orderBy.join(',')}`;
    }
    return new Promise(((resolve, reject) => {
      db.get(sql, [], (error, row) => {
        if (error) {
          reject(error);
        } else {
          resolve(row);
        }
      });
    }));
  }
function get(tableName, fieldNames, where, orderBy) {
    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 (where) {
      sql += ` WHERE ${where}`;
    }
    if (orderBy) {
      sql += ` ORDER BY ${orderBy.join(',')}`;
    }
    return new Promise(((resolve, reject) => {
      db.get(sql, [], (error, row) => {
        if (error) {
          reject(error);
        } else {
          resolve(row);
        }
      });
    }));
  }
function get ( tableName , fieldNames , where , orderBy ) { if ( orderBy && ! checkOrderBy ( orderBy ) ) { throw new Error ( 'Invalid arg: orderBy' ) ; } if ( ! db ) { throw new Error ( 'Not connected' ) ; } let sql = ` ${ fieldNames . join ( ',' ) } ${ tableName } ` ; if ( where ) { sql += ` ${ where } ` ; } if ( orderBy ) { sql += ` ${ orderBy . join ( ',' ) } ` ; } return new Promise ( ( ( resolve , reject ) => { db . get ( sql , [ ] , ( error , row ) => { if ( error ) { reject ( error ) ; } else { resolve ( row ) ; } } ) ; } ) ) ; }
return single row
return single row