@sqb/builder 4.15.0 → 4.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +3 -0
- package/esm/classes.ns.js +38 -41
- package/esm/enums.js +8 -11
- package/esm/extensions.js +1 -5
- package/esm/helpers.js +1 -4
- package/esm/index.js +20 -25
- package/esm/op.initializers.js +46 -78
- package/esm/package.json +3 -0
- package/esm/query/delete-query.js +11 -15
- package/esm/query/insert-query.js +13 -17
- package/esm/query/query.js +10 -15
- package/esm/query/returning-query.js +8 -12
- package/esm/query/select-query.js +28 -32
- package/esm/query/union-query.js +4 -8
- package/esm/query/update-query.js +14 -18
- package/esm/serializable.js +1 -5
- package/esm/serialize-context.js +15 -19
- package/esm/sql-objects/base-field.js +2 -6
- package/esm/sql-objects/case-statement.js +6 -10
- package/esm/sql-objects/coalesce-statement.js +4 -8
- package/esm/sql-objects/count-statement.js +4 -8
- package/esm/sql-objects/expression.js +2 -6
- package/esm/sql-objects/field-expression.js +4 -8
- package/esm/sql-objects/group-column.js +4 -8
- package/esm/sql-objects/join-statement.js +19 -23
- package/esm/sql-objects/lower-statement.js +4 -8
- package/esm/sql-objects/max-statement.js +4 -8
- package/esm/sql-objects/min-statement.js +4 -8
- package/esm/sql-objects/operator.js +2 -6
- package/esm/sql-objects/operators/comp-operator.js +13 -17
- package/esm/sql-objects/operators/logical-operator.js +16 -21
- package/esm/sql-objects/operators/op-and.js +4 -8
- package/esm/sql-objects/operators/op-between.js +4 -8
- package/esm/sql-objects/operators/op-eq.js +4 -8
- package/esm/sql-objects/operators/op-exists.js +6 -10
- package/esm/sql-objects/operators/op-gt.js +4 -8
- package/esm/sql-objects/operators/op-gte.js +4 -8
- package/esm/sql-objects/operators/op-ilike.js +4 -8
- package/esm/sql-objects/operators/op-in.js +6 -10
- package/esm/sql-objects/operators/op-is-not.js +4 -8
- package/esm/sql-objects/operators/op-is.js +4 -8
- package/esm/sql-objects/operators/op-like.js +4 -8
- package/esm/sql-objects/operators/op-lt.js +4 -8
- package/esm/sql-objects/operators/op-lte.js +4 -8
- package/esm/sql-objects/operators/op-ne.js +4 -8
- package/esm/sql-objects/operators/op-not-between.js +4 -8
- package/esm/sql-objects/operators/op-not-exists.js +4 -8
- package/esm/sql-objects/operators/op-not-ilike.js +4 -8
- package/esm/sql-objects/operators/op-not-in.js +4 -8
- package/esm/sql-objects/operators/op-not-like.js +4 -8
- package/esm/sql-objects/operators/op-not.js +5 -9
- package/esm/sql-objects/operators/op-or.js +4 -8
- package/esm/sql-objects/order-column.js +4 -8
- package/esm/sql-objects/param-expression.js +4 -8
- package/esm/sql-objects/raw-statement.js +4 -8
- package/esm/sql-objects/returning-column.js +4 -8
- package/esm/sql-objects/sequence-getter-statement.js +4 -8
- package/esm/sql-objects/string-agg-statement.js +11 -15
- package/esm/sql-objects/table-name.js +4 -8
- package/esm/sql-objects/upper-statement.js +4 -8
- package/esm/sqlobject.initializers.js +101 -131
- package/esm/typeguards.js +59 -80
- package/esm/types.js +1 -2
- package/package.json +20 -11
- package/types/query/select-query.d.ts +1 -1
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../enums.js");
|
|
5
|
-
const serializable_js_1 = require("../serializable.js");
|
|
6
|
-
class MinStatement extends serializable_js_1.Serializable {
|
|
1
|
+
import { SerializationType } from '../enums.js';
|
|
2
|
+
import { Serializable } from '../serializable.js';
|
|
3
|
+
export class MinStatement extends Serializable {
|
|
7
4
|
constructor(expression) {
|
|
8
5
|
super();
|
|
9
6
|
this._expression = expression;
|
|
10
7
|
}
|
|
11
8
|
get _type() {
|
|
12
|
-
return
|
|
9
|
+
return SerializationType.MIN_STATEMENT;
|
|
13
10
|
}
|
|
14
11
|
/**
|
|
15
12
|
* Sets alias to case expression.
|
|
@@ -35,4 +32,3 @@ class MinStatement extends serializable_js_1.Serializable {
|
|
|
35
32
|
return 'min(' + o + ')' + (this._alias ? ' ' + this._alias : '');
|
|
36
33
|
}
|
|
37
34
|
}
|
|
38
|
-
exports.MinStatement = MinStatement;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.Operator = void 0;
|
|
4
|
-
const serializable_js_1 = require("../serializable.js");
|
|
5
|
-
class Operator extends serializable_js_1.Serializable {
|
|
1
|
+
import { Serializable } from '../serializable.js';
|
|
2
|
+
export class Operator extends Serializable {
|
|
6
3
|
}
|
|
7
|
-
exports.Operator = Operator;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const field_expression_js_1 = require("../field-expression.js");
|
|
8
|
-
const operator_js_1 = require("../operator.js");
|
|
9
|
-
const param_expression_js_1 = require("../param-expression.js");
|
|
1
|
+
import { SerializationType } from '../../enums.js';
|
|
2
|
+
import { Serializable } from '../../serializable.js';
|
|
3
|
+
import { Param } from '../../sqlobject.initializers.js';
|
|
4
|
+
import { FieldExpression } from '../field-expression.js';
|
|
5
|
+
import { Operator } from '../operator.js';
|
|
6
|
+
import { ParamExpression } from '../param-expression.js';
|
|
10
7
|
const EXPRESSION_PATTERN = /^([\w\\.$]+)(\[])?/;
|
|
11
|
-
class CompOperator extends
|
|
8
|
+
export class CompOperator extends Operator {
|
|
12
9
|
constructor(left, right) {
|
|
13
10
|
super();
|
|
14
11
|
if (typeof left === 'string') {
|
|
@@ -23,7 +20,7 @@ class CompOperator extends operator_js_1.Operator {
|
|
|
23
20
|
this._right = right;
|
|
24
21
|
}
|
|
25
22
|
get _type() {
|
|
26
|
-
return
|
|
23
|
+
return SerializationType.COMPARISON_EXPRESSION;
|
|
27
24
|
}
|
|
28
25
|
_serialize(ctx) {
|
|
29
26
|
const left = this.__serializeItem(ctx, this._left);
|
|
@@ -39,23 +36,23 @@ class CompOperator extends operator_js_1.Operator {
|
|
|
39
36
|
return this.__serialize(ctx, o);
|
|
40
37
|
}
|
|
41
38
|
__serializeItem(ctx, x, isRight) {
|
|
42
|
-
if (ctx.strictParams && !(x instanceof
|
|
39
|
+
if (ctx.strictParams && !(x instanceof Serializable) && (typeof x !== 'string' || isRight)) {
|
|
43
40
|
ctx.strictParamGenId = ctx.strictParamGenId || 0;
|
|
44
41
|
const name = 'P$_' + ++ctx.strictParamGenId;
|
|
45
42
|
ctx.params = ctx.params || {};
|
|
46
43
|
ctx.params[name] = x;
|
|
47
|
-
x =
|
|
44
|
+
x = Param(name);
|
|
48
45
|
}
|
|
49
|
-
if (x instanceof
|
|
46
|
+
if (x instanceof Serializable) {
|
|
50
47
|
const expression = ctx.anyToSQL(x);
|
|
51
48
|
const result = {
|
|
52
49
|
expression,
|
|
53
50
|
};
|
|
54
|
-
if (x instanceof
|
|
51
|
+
if (x instanceof FieldExpression) {
|
|
55
52
|
result.dataType = result._dataType;
|
|
56
53
|
result.isArray = x._isArray;
|
|
57
54
|
}
|
|
58
|
-
if (x instanceof
|
|
55
|
+
if (x instanceof ParamExpression) {
|
|
59
56
|
let value = ctx.params ? ctx.params[x._name] : undefined;
|
|
60
57
|
if (x._isArray && value != null)
|
|
61
58
|
value = [value];
|
|
@@ -79,4 +76,3 @@ class CompOperator extends operator_js_1.Operator {
|
|
|
79
76
|
return o.left.expression + ' ' + o.symbol + ' ' + o.right.expression;
|
|
80
77
|
}
|
|
81
78
|
}
|
|
82
|
-
exports.CompOperator = CompOperator;
|
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const helpers_js_1 = require("../../helpers.js");
|
|
8
|
-
const typeguards_js_1 = require("../../typeguards.js");
|
|
9
|
-
const operator_js_1 = require("../operator.js");
|
|
10
|
-
exports.WrapOps = {};
|
|
1
|
+
import isPlainObject from 'putil-isplainobject';
|
|
2
|
+
import { SerializationType } from '../../enums.js';
|
|
3
|
+
import { printArray } from '../../helpers.js';
|
|
4
|
+
import { isCompOperator, isLogicalOperator, isNotOperator, isRawStatement } from '../../typeguards.js';
|
|
5
|
+
import { Operator } from '../operator.js';
|
|
6
|
+
export const WrapOps = {};
|
|
11
7
|
// noinspection RegExpUnnecessaryNonCapturingGroup
|
|
12
8
|
const COMPARE_LEFT_PATTERN = /^([\w\\.$]+(?:\[])?) *(.*)$/;
|
|
13
|
-
class LogicalOperator extends
|
|
9
|
+
export class LogicalOperator extends Operator {
|
|
14
10
|
constructor(...expressions) {
|
|
15
11
|
super();
|
|
16
12
|
this._items = [];
|
|
17
13
|
this.add(...expressions);
|
|
18
14
|
}
|
|
19
15
|
get _type() {
|
|
20
|
-
return
|
|
16
|
+
return SerializationType.LOGICAL_EXPRESSION;
|
|
21
17
|
}
|
|
22
18
|
/**
|
|
23
19
|
* Adds operator(s) to item list
|
|
@@ -26,13 +22,13 @@ class LogicalOperator extends operator_js_1.Operator {
|
|
|
26
22
|
for (const item of expressions) {
|
|
27
23
|
if (!item)
|
|
28
24
|
continue;
|
|
29
|
-
if (
|
|
25
|
+
if (isLogicalOperator(item)) {
|
|
30
26
|
this._items.push(item);
|
|
31
27
|
}
|
|
32
|
-
else if (
|
|
28
|
+
else if (isRawStatement(item) || isCompOperator(item) || isNotOperator(item)) {
|
|
33
29
|
this._items.push(item);
|
|
34
30
|
}
|
|
35
|
-
else if ((
|
|
31
|
+
else if (isPlainObject(item)) {
|
|
36
32
|
this.add(...this._wrapObject(item));
|
|
37
33
|
}
|
|
38
34
|
else
|
|
@@ -48,8 +44,8 @@ class LogicalOperator extends operator_js_1.Operator {
|
|
|
48
44
|
if (s)
|
|
49
45
|
arr.push(s);
|
|
50
46
|
}
|
|
51
|
-
return ctx.serialize(
|
|
52
|
-
const s =
|
|
47
|
+
return ctx.serialize(SerializationType.LOGICAL_EXPRESSION, arr, () => {
|
|
48
|
+
const s = printArray(arr, ' ' + String(this._operatorType));
|
|
53
49
|
return s.indexOf('\n') > 0 ? s.replace('\n', '\n\t') + '\b' : s;
|
|
54
50
|
});
|
|
55
51
|
}
|
|
@@ -60,19 +56,19 @@ class LogicalOperator extends operator_js_1.Operator {
|
|
|
60
56
|
let op;
|
|
61
57
|
const v = obj[n];
|
|
62
58
|
if (['and', 'or'].includes(n.toLowerCase())) {
|
|
63
|
-
op =
|
|
59
|
+
op = WrapOps[n.toLowerCase()];
|
|
64
60
|
if (!op)
|
|
65
61
|
throw new Error(`Unknown operator "${n}"`);
|
|
66
62
|
result.push(Array.isArray(v) ? op(...v) : op(v));
|
|
67
63
|
continue;
|
|
68
64
|
}
|
|
69
65
|
if (['exists', '!exists'].includes(n))
|
|
70
|
-
result.push(
|
|
66
|
+
result.push(WrapOps[n](obj[n]));
|
|
71
67
|
else {
|
|
72
68
|
const m = n.match(COMPARE_LEFT_PATTERN);
|
|
73
69
|
if (!m)
|
|
74
70
|
throw new TypeError(`"${n}" is not a valid expression definition`);
|
|
75
|
-
op =
|
|
71
|
+
op = WrapOps[m[2] || 'eq'];
|
|
76
72
|
if (!op)
|
|
77
73
|
throw new Error(`Unknown operator "${m[2]}"`);
|
|
78
74
|
result.push(op(m[1], obj[n]));
|
|
@@ -81,4 +77,3 @@ class LogicalOperator extends operator_js_1.Operator {
|
|
|
81
77
|
return result;
|
|
82
78
|
}
|
|
83
79
|
}
|
|
84
|
-
exports.LogicalOperator = LogicalOperator;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const logical_operator_js_1 = require("./logical-operator.js");
|
|
6
|
-
class OpAnd extends logical_operator_js_1.LogicalOperator {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { LogicalOperator } from './logical-operator.js';
|
|
3
|
+
export class OpAnd extends LogicalOperator {
|
|
7
4
|
constructor() {
|
|
8
5
|
super(...arguments);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.and;
|
|
10
7
|
}
|
|
11
8
|
}
|
|
12
|
-
exports.OpAnd = OpAnd;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
|
-
class OpBetween extends comp_operator_js_1.CompOperator {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { CompOperator } from './comp-operator.js';
|
|
3
|
+
export class OpBetween extends CompOperator {
|
|
7
4
|
constructor(left, right) {
|
|
8
5
|
super(left, right);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.between;
|
|
10
7
|
this._symbol = 'between';
|
|
11
8
|
if (right && right[1] == null)
|
|
12
9
|
right[1] = right[0];
|
|
@@ -28,4 +25,3 @@ class OpBetween extends comp_operator_js_1.CompOperator {
|
|
|
28
25
|
return o.left.expression + ' ' + o.symbol + ' ' + o.right[0].expression + ' and ' + o.right[1].expression;
|
|
29
26
|
}
|
|
30
27
|
}
|
|
31
|
-
exports.OpBetween = OpBetween;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
|
-
class OpEq extends comp_operator_js_1.CompOperator {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { CompOperator } from './comp-operator.js';
|
|
3
|
+
export class OpEq extends CompOperator {
|
|
7
4
|
constructor(left, right) {
|
|
8
5
|
super(left, right);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.eq;
|
|
10
7
|
this._symbol = '=';
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.OpEq = OpEq;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const typeguards_js_1 = require("../../typeguards.js");
|
|
6
|
-
const comp_operator_js_1 = require("./comp-operator.js");
|
|
7
|
-
class OpExists extends comp_operator_js_1.CompOperator {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { isSelectQuery } from '../../typeguards.js';
|
|
3
|
+
import { CompOperator } from './comp-operator.js';
|
|
4
|
+
export class OpExists extends CompOperator {
|
|
8
5
|
constructor(query) {
|
|
9
6
|
super(query);
|
|
10
|
-
this._operatorType =
|
|
7
|
+
this._operatorType = OperatorType.exists;
|
|
11
8
|
this._symbol = 'exists';
|
|
12
|
-
if (!(typeof query === 'object' &&
|
|
9
|
+
if (!(typeof query === 'object' && isSelectQuery(query))) {
|
|
13
10
|
throw new TypeError('You must provide a SelectQuery in `exists()`');
|
|
14
11
|
}
|
|
15
12
|
}
|
|
@@ -28,4 +25,3 @@ class OpExists extends comp_operator_js_1.CompOperator {
|
|
|
28
25
|
return o.left.expression ? o.symbol + ' ' + o.left.expression : '';
|
|
29
26
|
}
|
|
30
27
|
}
|
|
31
|
-
exports.OpExists = OpExists;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
|
-
class OpGt extends comp_operator_js_1.CompOperator {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { CompOperator } from './comp-operator.js';
|
|
3
|
+
export class OpGt extends CompOperator {
|
|
7
4
|
constructor(left, right) {
|
|
8
5
|
super(left, right);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.gt;
|
|
10
7
|
this._symbol = '>';
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.OpGt = OpGt;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
|
-
class OpGte extends comp_operator_js_1.CompOperator {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { CompOperator } from './comp-operator.js';
|
|
3
|
+
export class OpGte extends CompOperator {
|
|
7
4
|
constructor(left, right) {
|
|
8
5
|
super(left, right);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.gte;
|
|
10
7
|
this._symbol = '>=';
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.OpGte = OpGte;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const op_like_js_1 = require("./op-like.js");
|
|
6
|
-
class OpILike extends op_like_js_1.OpLike {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { OpLike } from './op-like.js';
|
|
3
|
+
export class OpILike extends OpLike {
|
|
7
4
|
constructor() {
|
|
8
5
|
super(...arguments);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.iLike;
|
|
10
7
|
this._symbol = 'ilike';
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.OpILike = OpILike;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const typeguards_js_1 = require("../../typeguards.js");
|
|
6
|
-
const comp_operator_js_1 = require("./comp-operator.js");
|
|
7
|
-
class OpIn extends comp_operator_js_1.CompOperator {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { isSerializable } from '../../typeguards.js';
|
|
3
|
+
import { CompOperator } from './comp-operator.js';
|
|
4
|
+
export class OpIn extends CompOperator {
|
|
8
5
|
constructor(left, right) {
|
|
9
|
-
super(left, Array.isArray(right) ||
|
|
10
|
-
this._operatorType =
|
|
6
|
+
super(left, Array.isArray(right) || isSerializable(right) ? right : [right]);
|
|
7
|
+
this._operatorType = OperatorType.in;
|
|
11
8
|
this._symbol = 'in';
|
|
12
9
|
}
|
|
13
10
|
_serialize(ctx) {
|
|
@@ -16,4 +13,3 @@ class OpIn extends comp_operator_js_1.CompOperator {
|
|
|
16
13
|
return super._serialize(ctx);
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
|
-
exports.OpIn = OpIn;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
|
-
class OpIsNot extends comp_operator_js_1.CompOperator {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { CompOperator } from './comp-operator.js';
|
|
3
|
+
export class OpIsNot extends CompOperator {
|
|
7
4
|
constructor(left, right) {
|
|
8
5
|
super(left, right);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.isNot;
|
|
10
7
|
this._symbol = 'is not';
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.OpIsNot = OpIsNot;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
|
-
class OpIs extends comp_operator_js_1.CompOperator {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { CompOperator } from './comp-operator.js';
|
|
3
|
+
export class OpIs extends CompOperator {
|
|
7
4
|
constructor(left, right) {
|
|
8
5
|
super(left, right);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.is;
|
|
10
7
|
this._symbol = 'is';
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.OpIs = OpIs;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
|
-
class OpLike extends comp_operator_js_1.CompOperator {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { CompOperator } from './comp-operator.js';
|
|
3
|
+
export class OpLike extends CompOperator {
|
|
7
4
|
constructor(left, right) {
|
|
8
5
|
super(left, right);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.like;
|
|
10
7
|
this._symbol = 'like';
|
|
11
8
|
}
|
|
12
9
|
__serialize(ctx, o) {
|
|
@@ -17,4 +14,3 @@ class OpLike extends comp_operator_js_1.CompOperator {
|
|
|
17
14
|
return ctx.serialize(this._type, o, (_ctx, _o) => this.__defaultSerialize(_ctx, _o));
|
|
18
15
|
}
|
|
19
16
|
}
|
|
20
|
-
exports.OpLike = OpLike;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
|
-
class OpLt extends comp_operator_js_1.CompOperator {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { CompOperator } from './comp-operator.js';
|
|
3
|
+
export class OpLt extends CompOperator {
|
|
7
4
|
constructor(left, right) {
|
|
8
5
|
super(left, right);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.lt;
|
|
10
7
|
this._symbol = '<';
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.OpLt = OpLt;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
|
-
class OpLte extends comp_operator_js_1.CompOperator {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { CompOperator } from './comp-operator.js';
|
|
3
|
+
export class OpLte extends CompOperator {
|
|
7
4
|
constructor(left, right) {
|
|
8
5
|
super(left, right);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.lte;
|
|
10
7
|
this._symbol = '<=';
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.OpLte = OpLte;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
|
-
class OpNe extends comp_operator_js_1.CompOperator {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { CompOperator } from './comp-operator.js';
|
|
3
|
+
export class OpNe extends CompOperator {
|
|
7
4
|
constructor(left, right) {
|
|
8
5
|
super(left, right);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.ne;
|
|
10
7
|
this._symbol = '!=';
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.OpNe = OpNe;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const op_between_js_1 = require("./op-between.js");
|
|
6
|
-
class OpNotBetween extends op_between_js_1.OpBetween {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { OpBetween } from './op-between.js';
|
|
3
|
+
export class OpNotBetween extends OpBetween {
|
|
7
4
|
constructor() {
|
|
8
5
|
super(...arguments);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.notBetween;
|
|
10
7
|
this._symbol = 'not between';
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.OpNotBetween = OpNotBetween;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const op_exists_js_1 = require("./op-exists.js");
|
|
6
|
-
class OpNotExists extends op_exists_js_1.OpExists {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { OpExists } from './op-exists.js';
|
|
3
|
+
export class OpNotExists extends OpExists {
|
|
7
4
|
constructor() {
|
|
8
5
|
super(...arguments);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.notExists;
|
|
10
7
|
this._symbol = 'not exists';
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.OpNotExists = OpNotExists;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const op_ilike_js_1 = require("./op-ilike.js");
|
|
6
|
-
class OpNotILike extends op_ilike_js_1.OpILike {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { OpILike } from './op-ilike.js';
|
|
3
|
+
export class OpNotILike extends OpILike {
|
|
7
4
|
constructor() {
|
|
8
5
|
super(...arguments);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.notILike;
|
|
10
7
|
this._symbol = 'not ilike';
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.OpNotILike = OpNotILike;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const op_in_js_1 = require("./op-in.js");
|
|
6
|
-
class OpNotIn extends op_in_js_1.OpIn {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { OpIn } from './op-in.js';
|
|
3
|
+
export class OpNotIn extends OpIn {
|
|
7
4
|
constructor() {
|
|
8
5
|
super(...arguments);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.notIn;
|
|
10
7
|
this._symbol = 'not in';
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.OpNotIn = OpNotIn;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const op_like_js_1 = require("./op-like.js");
|
|
6
|
-
class OpNotLike extends op_like_js_1.OpLike {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { OpLike } from './op-like.js';
|
|
3
|
+
export class OpNotLike extends OpLike {
|
|
7
4
|
constructor() {
|
|
8
5
|
super(...arguments);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.notLike;
|
|
10
7
|
this._symbol = 'not like';
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.OpNotLike = OpNotLike;
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const operator_js_1 = require("../operator.js");
|
|
6
|
-
class OpNot extends operator_js_1.Operator {
|
|
1
|
+
import { OperatorType, SerializationType } from '../../enums.js';
|
|
2
|
+
import { Operator } from '../operator.js';
|
|
3
|
+
export class OpNot extends Operator {
|
|
7
4
|
constructor(expression) {
|
|
8
5
|
super();
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.not;
|
|
10
7
|
this._expression = expression;
|
|
11
8
|
}
|
|
12
9
|
get _type() {
|
|
13
|
-
return
|
|
10
|
+
return SerializationType.NEGATIVE_EXPRESSION;
|
|
14
11
|
}
|
|
15
12
|
_serialize(ctx) {
|
|
16
13
|
const expression = ctx.anyToSQL(this._expression);
|
|
17
14
|
return ctx.serialize(this._type, expression, () => (expression ? 'not ' + expression : ''));
|
|
18
15
|
}
|
|
19
16
|
}
|
|
20
|
-
exports.OpNot = OpNot;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const enums_js_1 = require("../../enums.js");
|
|
5
|
-
const logical_operator_js_1 = require("./logical-operator.js");
|
|
6
|
-
class OpOr extends logical_operator_js_1.LogicalOperator {
|
|
1
|
+
import { OperatorType } from '../../enums.js';
|
|
2
|
+
import { LogicalOperator } from './logical-operator.js';
|
|
3
|
+
export class OpOr extends LogicalOperator {
|
|
7
4
|
constructor() {
|
|
8
5
|
super(...arguments);
|
|
9
|
-
this._operatorType =
|
|
6
|
+
this._operatorType = OperatorType.or;
|
|
10
7
|
}
|
|
11
8
|
}
|
|
12
|
-
exports.OpOr = OpOr;
|