"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OracleDialect = void 0;
const Dialect_1 = require("./Dialect");
class OracleDialect extends Dialect_1.Dialect {
    getPageSql(sql, boundSql, offset, limit) {
        limit = offset >= 1 ? offset + limit : limit;
        boundSql.addParameter(limit);
        boundSql.addParameter(offset);
        return ('SELECT * FROM ( SELECT TMP.*, ROWNUM ROW_ID FROM ( ' +
            sql +
            ' ) TMP WHERE ROWNUM <= ? ) WHERE ROW_ID > ?');
    }
    match(dataSource) {
        const dialect = dataSource.options['_dialect'];
        return dialect === 'oracle';
    }
}
exports.OracleDialect = OracleDialect;
