paginateSQL(sql, orderBy, options) {
    let sqlStatement = sql;
    const opts = options || {};
    let limitClause = '';
    if (opts.offset || opts.skip || opts.limit) {
      // Offset starts from 0
      let offset = Number(opts.offset || opts.skip || 0);
      if (Number.isNaN(offset)) {
        offset = 0;
      }
      if (opts.limit) {
        let limit = Number(opts.limit);
        if (Number.isNaN(limit)) {
          limit = 0;
        }
        limitClause = ` FETCH FIRST ${limit} ROWS ONLY`;
      }
    }
    if (orderBy) {
      sqlStatement = `${sqlStatement} ORDER BY ${orderBy}`;
    }

    return `${sqlStatement} ${limitClause}`;
  }
/**
   * Paginate the results returned from database
   * @param {String} sql The sql to execute
   * @param {Object} orderBy The property name by which results are ordered
   * @param {Object} options Options for discoverDatabaseSchemas
   */
Paginate the results returned from database
@param {String} sql The sql to execute
@param {Object} orderBy The property name by which results are ordered
@param {Object} options Options for discoverDatabaseSchemas
Paginate the results returned from database @param { String } sql The sql to execute @param { Object } orderBy The property name by which results are ordered @param { Object } options Options for discoverDatabaseSchemas
paginateSQL(sql, orderBy, options) {
    let sqlStatement = sql;
    const opts = options || {};
    let limitClause = '';
    if (opts.offset || opts.skip || opts.limit) {
      let offset = Number(opts.offset || opts.skip || 0);
      if (Number.isNaN(offset)) {
        offset = 0;
      }
      if (opts.limit) {
        let limit = Number(opts.limit);
        if (Number.isNaN(limit)) {
          limit = 0;
        }
        limitClause = ` FETCH FIRST ${limit} ROWS ONLY`;
      }
    }
    if (orderBy) {
      sqlStatement = `${sqlStatement} ORDER BY ${orderBy}`;
    }
    return `${sqlStatement} ${limitClause}`;
  }
paginateSQL ( sql , orderBy , options ) { let sqlStatement = sql ; const opts = options || { } ; let limitClause = '' ; if ( opts . offset || opts . skip || opts . limit ) { let offset = Number ( opts . offset || opts . skip || 0 ) ; if ( Number . isNaN ( offset ) ) { offset = 0 ; } if ( opts . limit ) { let limit = Number ( opts . limit ) ; if ( Number . isNaN ( limit ) ) { limit = 0 ; } limitClause = ` ${ limit } ` ; } } if ( orderBy ) { sqlStatement = ` ${ sqlStatement } ${ orderBy } ` ; } return ` ${ sqlStatement } ${ limitClause } ` ; }
Paginate the results returned from database
 @param {String} sql The sql to execute
 @param {Object} orderBy The property name by which results are ordered
 @param {Object} options Options for discoverDatabaseSchemas
Paginate the results returned from database @param { String } sql The sql to execute @param { Object } orderBy The property name by which results are ordered @param { Object } options Options for discoverDatabaseSchemas
// Offset starts from 0