@stoqey/sofa
Version:
Couchbase utilities
90 lines • 4.61 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.IndexParamsUsingGSIExceptions = exports.IndexParamsOnExceptions = exports.QueryGroupByParamsException = exports.QueryOperatorNotFoundException = exports.MultipleQueryTypesException = exports.InWithinOperatorExceptions = exports.WhereClauseException = exports.SelectClauseException = void 0;
var SelectClauseException = /** @class */ (function (_super) {
__extends(SelectClauseException, _super);
function SelectClauseException() {
// todo update message
return _super.call(this, 'The SELECT clause does not have the proper structure') || this;
}
return SelectClauseException;
}(Error));
exports.SelectClauseException = SelectClauseException;
var WhereClauseException = /** @class */ (function (_super) {
__extends(WhereClauseException, _super);
function WhereClauseException() {
return _super.call(this, 'The WHERE clause does not have the proper structure') || this;
}
return WhereClauseException;
}(Error));
exports.WhereClauseException = WhereClauseException;
var InWithinOperatorExceptions = /** @class */ (function (_super) {
__extends(InWithinOperatorExceptions, _super);
function InWithinOperatorExceptions() {
var _this = _super.call(this) || this;
_this.message = "The search_expr, target_expr and operator (IN | WITHIN) values are required for collection operators.";
return _this;
}
return InWithinOperatorExceptions;
}(WhereClauseException));
exports.InWithinOperatorExceptions = InWithinOperatorExceptions;
var MultipleQueryTypesException = /** @class */ (function (_super) {
__extends(MultipleQueryTypesException, _super);
function MultipleQueryTypesException(type1, type2) {
return _super.call(this, "Cannot combine multiple query types (ex: " + type1 + " with " + type2) || this;
}
return MultipleQueryTypesException;
}(Error));
exports.MultipleQueryTypesException = MultipleQueryTypesException;
var QueryOperatorNotFoundException = /** @class */ (function (_super) {
__extends(QueryOperatorNotFoundException, _super);
function QueryOperatorNotFoundException(operator) {
var _this = _super.call(this) || this;
_this.message = "Operator not found: " + operator;
return _this;
}
return QueryOperatorNotFoundException;
}(WhereClauseException));
exports.QueryOperatorNotFoundException = QueryOperatorNotFoundException;
var QueryGroupByParamsException = /** @class */ (function (_super) {
__extends(QueryGroupByParamsException, _super);
function QueryGroupByParamsException() {
var _this = _super.call(this) || this;
_this.message = "The GROUP BY clause must be defined to use the LETTING and HAVING clauses";
return _this;
}
return QueryGroupByParamsException;
}(WhereClauseException));
exports.QueryGroupByParamsException = QueryGroupByParamsException;
var IndexParamsOnExceptions = /** @class */ (function (_super) {
__extends(IndexParamsOnExceptions, _super);
function IndexParamsOnExceptions(clause) {
return _super.call(this, "The ON parameter can only be applied in the following clauses: " + JSON.stringify(clause)) || this;
}
return IndexParamsOnExceptions;
}(Error));
exports.IndexParamsOnExceptions = IndexParamsOnExceptions;
var IndexParamsUsingGSIExceptions = /** @class */ (function (_super) {
__extends(IndexParamsUsingGSIExceptions, _super);
function IndexParamsUsingGSIExceptions(clause) {
return _super.call(this, "The USING GSI parameter can only be applied in the following clauses: " + JSON.stringify(clause)) || this;
}
return IndexParamsUsingGSIExceptions;
}(Error));
exports.IndexParamsUsingGSIExceptions = IndexParamsUsingGSIExceptions;
//# sourceMappingURL=exceptions.js.map