"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DB2Dialect = void 0;
const Dialect_1 = require("./Dialect");
class DB2Dialect extends Dialect_1.Dialect {
    getPageSql(sql, boundSql, offset, limit) {
        boundSql.addParameter(offset + 1);
        boundSql.addParameter(offset + limit);
        return ('SELECT * FROM (SELECT TMP_PAGE.*,ROWNUMBER() OVER() AS ROW_ID FROM ( ' +
            sql +
            ' ) AS TMP_PAGE) TMP_PAGE WHERE ROW_ID BETWEEN ? AND ?');
    }
    match(dataSource) {
        const dialect = dataSource.options['_dialect'];
        return dialect === 'db2';
    }
}
exports.DB2Dialect = DB2Dialect;
