UNPKG

sphinxql

Version:

SphinxQL query builder for Node.JS. Supports Sphinx search(2.x and 3.x) and Manticore search

31 lines 1.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var BaseStatement_1 = require("./BaseStatement"); var AttachIndexStatement = (function (_super) { tslib_1.__extends(AttachIndexStatement, _super); function AttachIndexStatement(connection, diskIndex) { var _this = _super.call(this, connection) || this; _this.diskIndex = diskIndex; _this.truncate = false; return _this; } AttachIndexStatement.prototype.to = function (rtIndex) { this.rtIndex = rtIndex; return this; }; AttachIndexStatement.prototype.withTruncate = function () { this.truncate = true; return this; }; AttachIndexStatement.prototype.generate = function () { var expression = "ATTACH INDEX " + this.diskIndex + " TO RTINDEX " + this.rtIndex; if (this.truncate) { expression += " WITH TRUNCATE"; } return expression; }; return AttachIndexStatement; }(BaseStatement_1.default)); exports.default = AttachIndexStatement; //# sourceMappingURL=AttachIndexStatement.js.map