@sqb/builder 4.0.3 → 4.0.8

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.
Files changed (106) hide show
  1. package/LICENSE +191 -21
  2. package/package.json +11 -10
  3. package/dist/Serializable.d.ts +0 -9
  4. package/dist/Serializable.js +0 -6
  5. package/dist/SerializeContext.d.ts +0 -47
  6. package/dist/SerializeContext.js +0 -138
  7. package/dist/classes.d.ts +0 -38
  8. package/dist/classes.js +0 -50
  9. package/dist/enums.d.ts +0 -84
  10. package/dist/enums.js +0 -91
  11. package/dist/extensions.d.ts +0 -4
  12. package/dist/extensions.js +0 -16
  13. package/dist/helpers.d.ts +0 -4
  14. package/dist/helpers.js +0 -31
  15. package/dist/index.d.ts +0 -20
  16. package/dist/index.js +0 -48
  17. package/dist/op.initializers.d.ts +0 -86
  18. package/dist/op.initializers.js +0 -158
  19. package/dist/query/DeleteQuery.d.ts +0 -24
  20. package/dist/query/DeleteQuery.js +0 -53
  21. package/dist/query/InsertQuery.d.ts +0 -23
  22. package/dist/query/InsertQuery.js +0 -76
  23. package/dist/query/Query.d.ts +0 -15
  24. package/dist/query/Query.js +0 -42
  25. package/dist/query/ReturningQuery.d.ts +0 -14
  26. package/dist/query/ReturningQuery.js +0 -44
  27. package/dist/query/SelectQuery.d.ts +0 -90
  28. package/dist/query/SelectQuery.js +0 -283
  29. package/dist/query/UpdateQuery.d.ts +0 -29
  30. package/dist/query/UpdateQuery.js +0 -80
  31. package/dist/sql-objects/BaseField.d.ts +0 -7
  32. package/dist/sql-objects/BaseField.js +0 -11
  33. package/dist/sql-objects/CaseStatement.d.ts +0 -42
  34. package/dist/sql-objects/CaseStatement.js +0 -85
  35. package/dist/sql-objects/CountStatement.d.ts +0 -20
  36. package/dist/sql-objects/CountStatement.js +0 -34
  37. package/dist/sql-objects/Expression.d.ts +0 -7
  38. package/dist/sql-objects/Expression.js +0 -7
  39. package/dist/sql-objects/FieldExpression.d.ts +0 -14
  40. package/dist/sql-objects/FieldExpression.js +0 -53
  41. package/dist/sql-objects/GroupColumn.d.ts +0 -8
  42. package/dist/sql-objects/GroupColumn.js +0 -38
  43. package/dist/sql-objects/JoinStatement.d.ts +0 -17
  44. package/dist/sql-objects/JoinStatement.js +0 -81
  45. package/dist/sql-objects/Operator.d.ts +0 -5
  46. package/dist/sql-objects/Operator.js +0 -7
  47. package/dist/sql-objects/OrderColumn.d.ts +0 -9
  48. package/dist/sql-objects/OrderColumn.js +0 -42
  49. package/dist/sql-objects/ParamExpression.d.ts +0 -23
  50. package/dist/sql-objects/ParamExpression.js +0 -53
  51. package/dist/sql-objects/RawStatement.d.ts +0 -9
  52. package/dist/sql-objects/RawStatement.js +0 -18
  53. package/dist/sql-objects/ReturningColumn.d.ts +0 -9
  54. package/dist/sql-objects/ReturningColumn.js +0 -32
  55. package/dist/sql-objects/TableName.d.ts +0 -11
  56. package/dist/sql-objects/TableName.js +0 -31
  57. package/dist/sql-objects/operators/CompOperator.d.ts +0 -16
  58. package/dist/sql-objects/operators/CompOperator.js +0 -87
  59. package/dist/sql-objects/operators/LogicalOperator.d.ts +0 -16
  60. package/dist/sql-objects/operators/LogicalOperator.js +0 -85
  61. package/dist/sql-objects/operators/OpAnd.d.ts +0 -5
  62. package/dist/sql-objects/operators/OpAnd.js +0 -12
  63. package/dist/sql-objects/operators/OpBetween.d.ts +0 -11
  64. package/dist/sql-objects/operators/OpBetween.js +0 -35
  65. package/dist/sql-objects/operators/OpEq.d.ts +0 -8
  66. package/dist/sql-objects/operators/OpEq.js +0 -13
  67. package/dist/sql-objects/operators/OpExists.d.ts +0 -11
  68. package/dist/sql-objects/operators/OpExists.js +0 -30
  69. package/dist/sql-objects/operators/OpGt.d.ts +0 -8
  70. package/dist/sql-objects/operators/OpGt.js +0 -13
  71. package/dist/sql-objects/operators/OpGte.d.ts +0 -8
  72. package/dist/sql-objects/operators/OpGte.js +0 -13
  73. package/dist/sql-objects/operators/OpILike.d.ts +0 -6
  74. package/dist/sql-objects/operators/OpILike.js +0 -13
  75. package/dist/sql-objects/operators/OpIn.d.ts +0 -9
  76. package/dist/sql-objects/operators/OpIn.js +0 -19
  77. package/dist/sql-objects/operators/OpIs.d.ts +0 -8
  78. package/dist/sql-objects/operators/OpIs.js +0 -13
  79. package/dist/sql-objects/operators/OpIsNot.d.ts +0 -8
  80. package/dist/sql-objects/operators/OpIsNot.js +0 -13
  81. package/dist/sql-objects/operators/OpLike.d.ts +0 -10
  82. package/dist/sql-objects/operators/OpLike.js +0 -22
  83. package/dist/sql-objects/operators/OpLt.d.ts +0 -8
  84. package/dist/sql-objects/operators/OpLt.js +0 -13
  85. package/dist/sql-objects/operators/OpLte.d.ts +0 -8
  86. package/dist/sql-objects/operators/OpLte.js +0 -13
  87. package/dist/sql-objects/operators/OpNe.d.ts +0 -8
  88. package/dist/sql-objects/operators/OpNe.js +0 -13
  89. package/dist/sql-objects/operators/OpNotBetween.d.ts +0 -6
  90. package/dist/sql-objects/operators/OpNotBetween.js +0 -13
  91. package/dist/sql-objects/operators/OpNotExists.d.ts +0 -6
  92. package/dist/sql-objects/operators/OpNotExists.js +0 -13
  93. package/dist/sql-objects/operators/OpNotILike.d.ts +0 -6
  94. package/dist/sql-objects/operators/OpNotILike.js +0 -13
  95. package/dist/sql-objects/operators/OpNotIn.d.ts +0 -6
  96. package/dist/sql-objects/operators/OpNotIn.js +0 -13
  97. package/dist/sql-objects/operators/OpNotLike.d.ts +0 -6
  98. package/dist/sql-objects/operators/OpNotLike.js +0 -13
  99. package/dist/sql-objects/operators/OpOr.d.ts +0 -5
  100. package/dist/sql-objects/operators/OpOr.js +0 -12
  101. package/dist/sqlobject.initializers.d.ts +0 -39
  102. package/dist/sqlobject.initializers.js +0 -90
  103. package/dist/typeguards.d.ts +0 -34
  104. package/dist/typeguards.js +0 -73
  105. package/dist/types.d.ts +0 -33
  106. package/dist/types.js +0 -2
@@ -1,87 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CompOperator = void 0;
4
- const Operator_1 = require("../Operator");
5
- const Serializable_1 = require("../../Serializable");
6
- const enums_1 = require("../../enums");
7
- const typeguards_1 = require("../../typeguards");
8
- const sqlobject_initializers_1 = require("../../sqlobject.initializers");
9
- const ParamExpression_1 = require("../ParamExpression");
10
- const FieldExpression_1 = require("../FieldExpression");
11
- const EXPRESSION_PATTERN = /^([\w\\.$]+)(\[])?/;
12
- class CompOperator extends Operator_1.Operator {
13
- constructor(left, right) {
14
- super();
15
- if (typeof left === 'string') {
16
- const m = left.match(EXPRESSION_PATTERN);
17
- if (!m)
18
- throw new TypeError(`"${left}" is not a valid expression definition`);
19
- this._left = m[1];
20
- this._isArray = !!m[2];
21
- }
22
- else
23
- this._left = left;
24
- this._right = right;
25
- }
26
- get _type() {
27
- return enums_1.SerializationType.COMPARISON_EXPRESSION;
28
- }
29
- _serialize(ctx) {
30
- const left = this.__serializeItem(ctx, this._left);
31
- if (this._isArray)
32
- left.isArray = true;
33
- const right = this.__serializeItem(ctx, this._right, true);
34
- const o = {
35
- operatorType: this._operatorType,
36
- symbol: this._symbol,
37
- left,
38
- right
39
- };
40
- return this.__serialize(ctx, o);
41
- }
42
- __serializeItem(ctx, x, isRight) {
43
- if (ctx.strictParams && !(x instanceof Serializable_1.Serializable) &&
44
- (typeof x !== 'string' || isRight)) {
45
- ctx.strictParamGenId = ctx.strictParamGenId || 0;
46
- const name = 'strictParam$' + ++ctx.strictParamGenId;
47
- ctx.params = ctx.params || {};
48
- ctx.params[name] = x;
49
- x = (0, sqlobject_initializers_1.Param)(name);
50
- }
51
- if (x instanceof Serializable_1.Serializable) {
52
- const expression = x._serialize(ctx);
53
- const result = {
54
- expression: (0, typeguards_1.isSelectQuery)(x) ? '(' + expression + ')' : expression
55
- };
56
- if (x instanceof FieldExpression_1.FieldExpression) {
57
- result.dataType = result._dataType;
58
- result.isArray = x._isArray;
59
- }
60
- if (x instanceof ParamExpression_1.ParamExpression) {
61
- let value = ctx.params ? ctx.params[x._name] : undefined;
62
- if (x._isArray && value != null)
63
- value = [value];
64
- result.value = value;
65
- result.isArray = x._isArray || Array.isArray(value);
66
- result.isParam = true;
67
- }
68
- return result;
69
- }
70
- else {
71
- const result = {
72
- expression: (isRight || typeof x !== 'string') ?
73
- ctx.anyToSQL(x) : x
74
- };
75
- if (isRight || typeof x !== 'string')
76
- result.isArray = Array.isArray(x);
77
- return result;
78
- }
79
- }
80
- __serialize(ctx, o) {
81
- return ctx.serialize(this._type, o, (_ctx, _o) => this.__defaultSerialize(_ctx, _o));
82
- }
83
- __defaultSerialize(ctx, o) {
84
- return o.left.expression + ' ' + o.symbol + ' ' + o.right.expression;
85
- }
86
- }
87
- exports.CompOperator = CompOperator;
@@ -1,16 +0,0 @@
1
- import { Operator } from '../Operator';
2
- import { SerializationType } from '../../enums';
3
- import { Serializable } from '../../Serializable';
4
- import { SerializeContext } from '../../SerializeContext';
5
- export declare const WrapOps: {};
6
- export declare abstract class LogicalOperator extends Operator {
7
- _items: Serializable[];
8
- constructor(...expressions: any[]);
9
- get _type(): SerializationType;
10
- /**
11
- * Adds operator(s) to item list
12
- */
13
- add(...expressions: (LogicalOperator | any)[]): this;
14
- _serialize(ctx: SerializeContext): string;
15
- private _wrapObject;
16
- }
@@ -1,85 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.LogicalOperator = exports.WrapOps = void 0;
7
- const Operator_1 = require("../Operator");
8
- const putil_isplainobject_1 = __importDefault(require("putil-isplainobject"));
9
- const enums_1 = require("../../enums");
10
- const typeguards_1 = require("../../typeguards");
11
- const helpers_1 = require("../../helpers");
12
- exports.WrapOps = {};
13
- // noinspection RegExpUnnecessaryNonCapturingGroup
14
- const COMPARE_LEFT_PATTERN = /^([\w\\.$]+(?:\[])?) *(.*)$/;
15
- class LogicalOperator extends Operator_1.Operator {
16
- constructor(...expressions) {
17
- super();
18
- this._items = [];
19
- this.add(...expressions);
20
- }
21
- get _type() {
22
- return enums_1.SerializationType.LOGICAL_EXPRESSION;
23
- }
24
- /**
25
- * Adds operator(s) to item list
26
- */
27
- add(...expressions) {
28
- for (const item of expressions) {
29
- if (!item)
30
- continue;
31
- if ((0, typeguards_1.isLogicalOperator)(item)) {
32
- this._items.push(item);
33
- }
34
- else if ((0, typeguards_1.isRawStatement)(item) || (0, typeguards_1.isCompOperator)(item)) {
35
- this._items.push(item);
36
- }
37
- else if ((0, putil_isplainobject_1.default)(item)) {
38
- this.add(...this._wrapObject(item));
39
- }
40
- else
41
- throw new TypeError('Operator or Raw type required');
42
- }
43
- return this;
44
- }
45
- _serialize(ctx) {
46
- const arr = [];
47
- for (const t of this._items) {
48
- const s = t._serialize(ctx);
49
- /* istanbul ignore else */
50
- if (s)
51
- arr.push((0, typeguards_1.isLogicalOperator)(t) ? '(' + s + ')' : s);
52
- }
53
- return ctx.serialize(enums_1.SerializationType.LOGICAL_EXPRESSION, arr, () => {
54
- const s = (0, helpers_1.printArray)(arr, ' ' + String(this._operatorType));
55
- return (s.indexOf('\n') > 0) ? s.replace('\n', '\n\t') + '\b' : s;
56
- });
57
- }
58
- _wrapObject(obj) {
59
- const result = [];
60
- for (const n of Object.getOwnPropertyNames(obj)) {
61
- let op;
62
- const v = obj[n];
63
- if (['and', 'or'].includes(n.toLowerCase())) {
64
- op = exports.WrapOps[n.toLowerCase()];
65
- if (!op)
66
- throw new Error(`Unknown operator "${n}"`);
67
- result.push(Array.isArray(v) ? op(...v) : op(v));
68
- continue;
69
- }
70
- if (['exists', '!exists'].includes(n))
71
- result.push(exports.WrapOps[n](obj[n]));
72
- else {
73
- const m = n.match(COMPARE_LEFT_PATTERN);
74
- if (!m)
75
- throw new TypeError(`"${n}" is not a valid expression definition`);
76
- op = exports.WrapOps[m[2] || 'eq'];
77
- if (!op)
78
- throw new Error(`Unknown operator "${m[2]}"`);
79
- result.push(op(m[1], obj[n]));
80
- }
81
- }
82
- return result;
83
- }
84
- }
85
- exports.LogicalOperator = LogicalOperator;
@@ -1,5 +0,0 @@
1
- import { LogicalOperator } from './LogicalOperator';
2
- import { OperatorType } from '../../enums';
3
- export declare class OpAnd extends LogicalOperator {
4
- _operatorType: OperatorType;
5
- }
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpAnd = void 0;
4
- const LogicalOperator_1 = require("./LogicalOperator");
5
- const enums_1 = require("../../enums");
6
- class OpAnd extends LogicalOperator_1.LogicalOperator {
7
- constructor() {
8
- super(...arguments);
9
- this._operatorType = enums_1.OperatorType.and;
10
- }
11
- }
12
- exports.OpAnd = OpAnd;
@@ -1,11 +0,0 @@
1
- import { CompOperator } from './CompOperator';
2
- import { Serializable } from '../../Serializable';
3
- import { OperatorType } from '../../enums';
4
- import { SerializeContext } from '../../SerializeContext';
5
- export declare class OpBetween extends CompOperator {
6
- _operatorType: OperatorType;
7
- _symbol: string;
8
- constructor(left: string | Serializable, right: any[]);
9
- _serialize(ctx: SerializeContext): string;
10
- __defaultSerialize(ctx: any, o: any): string;
11
- }
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpBetween = void 0;
4
- const CompOperator_1 = require("./CompOperator");
5
- const enums_1 = require("../../enums");
6
- class OpBetween extends CompOperator_1.CompOperator {
7
- constructor(left, right) {
8
- super(left, right);
9
- this._operatorType = enums_1.OperatorType.between;
10
- this._symbol = 'between';
11
- if (right && right[1] == null)
12
- right[1] = right[0];
13
- }
14
- _serialize(ctx) {
15
- if (!(this._right && this._right.length > 0))
16
- return '';
17
- const left = this.__serializeItem(ctx, this._left);
18
- const right = [
19
- this.__serializeItem(ctx, this._right[0], true),
20
- this.__serializeItem(ctx, this._right[1], true)
21
- ];
22
- const o = {
23
- operatorType: this._operatorType,
24
- symbol: this._symbol,
25
- left,
26
- right
27
- };
28
- return this.__serialize(ctx, o);
29
- }
30
- __defaultSerialize(ctx, o) {
31
- return o.left.expression + ' ' + o.symbol + ' ' +
32
- o.right[0].expression + ' and ' + o.right[1].expression;
33
- }
34
- }
35
- exports.OpBetween = OpBetween;
@@ -1,8 +0,0 @@
1
- import { CompOperator } from './CompOperator';
2
- import { Serializable } from '../../Serializable';
3
- import { OperatorType } from '../../enums';
4
- export declare class OpEq extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: string | Serializable, right: any);
8
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpEq = void 0;
4
- const CompOperator_1 = require("./CompOperator");
5
- const enums_1 = require("../../enums");
6
- class OpEq extends CompOperator_1.CompOperator {
7
- constructor(left, right) {
8
- super(left, right);
9
- this._operatorType = enums_1.OperatorType.eq;
10
- this._symbol = '=';
11
- }
12
- }
13
- exports.OpEq = OpEq;
@@ -1,11 +0,0 @@
1
- import { OperatorType } from '../../enums';
2
- import { SelectQuery } from '../../query/SelectQuery';
3
- import { CompOperator } from './CompOperator';
4
- import { SerializeContext } from '../../SerializeContext';
5
- export declare class OpExists extends CompOperator {
6
- _operatorType: OperatorType;
7
- _symbol: string;
8
- constructor(query: SelectQuery);
9
- _serialize(ctx: SerializeContext): string;
10
- protected __defaultSerialize(ctx: SerializeContext, o: any): string;
11
- }
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpExists = void 0;
4
- const enums_1 = require("../../enums");
5
- const CompOperator_1 = require("./CompOperator");
6
- const typeguards_1 = require("../../typeguards");
7
- class OpExists extends CompOperator_1.CompOperator {
8
- constructor(query) {
9
- super(query);
10
- this._operatorType = enums_1.OperatorType.exists;
11
- this._symbol = 'exists';
12
- if (!(typeof query === 'object' && (0, typeguards_1.isSelectQuery)(query)))
13
- throw new TypeError('You must provide a SelectQuery in `exists()`');
14
- }
15
- _serialize(ctx) {
16
- const left = this.__serializeItem(ctx, this._left);
17
- if (this._isArray)
18
- left.isArray = true;
19
- const o = {
20
- operatorType: this._operatorType,
21
- symbol: this._symbol,
22
- left
23
- };
24
- return this.__serialize(ctx, o);
25
- }
26
- __defaultSerialize(ctx, o) {
27
- return o.left.expression ? o.symbol + ' ' + o.left.expression : '';
28
- }
29
- }
30
- exports.OpExists = OpExists;
@@ -1,8 +0,0 @@
1
- import { CompOperator } from './CompOperator';
2
- import { OperatorType } from '../../enums';
3
- import { Serializable } from '../../Serializable';
4
- export declare class OpGt extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: string | Serializable, right?: any);
8
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpGt = void 0;
4
- const CompOperator_1 = require("./CompOperator");
5
- const enums_1 = require("../../enums");
6
- class OpGt extends CompOperator_1.CompOperator {
7
- constructor(left, right) {
8
- super(left, right);
9
- this._operatorType = enums_1.OperatorType.gt;
10
- this._symbol = '>';
11
- }
12
- }
13
- exports.OpGt = OpGt;
@@ -1,8 +0,0 @@
1
- import { CompOperator } from './CompOperator';
2
- import { OperatorType } from '../../enums';
3
- import { Serializable } from '../../Serializable';
4
- export declare class OpGte extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: string | Serializable, right?: any);
8
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpGte = void 0;
4
- const CompOperator_1 = require("./CompOperator");
5
- const enums_1 = require("../../enums");
6
- class OpGte extends CompOperator_1.CompOperator {
7
- constructor(left, right) {
8
- super(left, right);
9
- this._operatorType = enums_1.OperatorType.gte;
10
- this._symbol = '>=';
11
- }
12
- }
13
- exports.OpGte = OpGte;
@@ -1,6 +0,0 @@
1
- import { OpLike } from './OpLike';
2
- import { OperatorType } from '../../enums';
3
- export declare class OpILike extends OpLike {
4
- _operatorType: OperatorType;
5
- _symbol: string;
6
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpILike = void 0;
4
- const OpLike_1 = require("./OpLike");
5
- const enums_1 = require("../../enums");
6
- class OpILike extends OpLike_1.OpLike {
7
- constructor() {
8
- super(...arguments);
9
- this._operatorType = enums_1.OperatorType.iLike;
10
- this._symbol = 'ilike';
11
- }
12
- }
13
- exports.OpILike = OpILike;
@@ -1,9 +0,0 @@
1
- import { CompOperator } from './CompOperator';
2
- import { OperatorType } from '../../enums';
3
- import { SerializeContext } from '../../SerializeContext';
4
- export declare class OpIn extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: any, right: any);
8
- _serialize(ctx: SerializeContext): string;
9
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpIn = void 0;
4
- const CompOperator_1 = require("./CompOperator");
5
- const enums_1 = require("../../enums");
6
- const typeguards_1 = require("../../typeguards");
7
- class OpIn extends CompOperator_1.CompOperator {
8
- constructor(left, right) {
9
- super(left, Array.isArray(right) || (0, typeguards_1.isSerializable)(right) ? right : [right]);
10
- this._operatorType = enums_1.OperatorType.in;
11
- this._symbol = 'in';
12
- }
13
- _serialize(ctx) {
14
- if (Array.isArray(this._right) && !this._right.length)
15
- return '';
16
- return super._serialize(ctx);
17
- }
18
- }
19
- exports.OpIn = OpIn;
@@ -1,8 +0,0 @@
1
- import { CompOperator } from './CompOperator';
2
- import { OperatorType } from '../../enums';
3
- import { Serializable } from '../../Serializable';
4
- export declare class OpIs extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: string | Serializable, right?: any);
8
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpIs = void 0;
4
- const CompOperator_1 = require("./CompOperator");
5
- const enums_1 = require("../../enums");
6
- class OpIs extends CompOperator_1.CompOperator {
7
- constructor(left, right) {
8
- super(left, right);
9
- this._operatorType = enums_1.OperatorType.is;
10
- this._symbol = 'is';
11
- }
12
- }
13
- exports.OpIs = OpIs;
@@ -1,8 +0,0 @@
1
- import { CompOperator } from './CompOperator';
2
- import { OperatorType } from '../../enums';
3
- import { Serializable } from '../../Serializable';
4
- export declare class OpIsNot extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: string | Serializable, right?: any);
8
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpIsNot = void 0;
4
- const CompOperator_1 = require("./CompOperator");
5
- const enums_1 = require("../../enums");
6
- class OpIsNot extends CompOperator_1.CompOperator {
7
- constructor(left, right) {
8
- super(left, right);
9
- this._operatorType = enums_1.OperatorType.isNot;
10
- this._symbol = 'is not';
11
- }
12
- }
13
- exports.OpIsNot = OpIsNot;
@@ -1,10 +0,0 @@
1
- import { CompOperator } from './CompOperator';
2
- import { OperatorType } from '../../enums';
3
- import { Serializable } from '../../Serializable';
4
- import { SerializeContext } from '../../SerializeContext';
5
- export declare class OpLike extends CompOperator {
6
- _operatorType: OperatorType;
7
- _symbol: string;
8
- constructor(left: string | Serializable, right?: any);
9
- protected __serialize(ctx: SerializeContext, o: any): string;
10
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpLike = void 0;
4
- const CompOperator_1 = require("./CompOperator");
5
- const enums_1 = require("../../enums");
6
- const typeguards_1 = require("../../typeguards");
7
- class OpLike extends CompOperator_1.CompOperator {
8
- constructor(left, right) {
9
- super(left, right);
10
- this._operatorType = enums_1.OperatorType.like;
11
- this._symbol = 'like';
12
- }
13
- __serialize(ctx, o) {
14
- if (o.right && typeof o.right !== 'string' && !(0, typeguards_1.isSerializable)(o.right))
15
- o.right = ctx.anyToSQL(o.right);
16
- if (!o.right)
17
- return '';
18
- o.right = ctx.anyToSQL(o.right);
19
- return ctx.serialize(this._type, o, (_ctx, _o) => this.__defaultSerialize(_ctx, _o));
20
- }
21
- }
22
- exports.OpLike = OpLike;
@@ -1,8 +0,0 @@
1
- import { CompOperator } from './CompOperator';
2
- import { OperatorType } from '../../enums';
3
- import { Serializable } from '../../Serializable';
4
- export declare class OpLt extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: string | Serializable, right?: any);
8
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpLt = void 0;
4
- const CompOperator_1 = require("./CompOperator");
5
- const enums_1 = require("../../enums");
6
- class OpLt extends CompOperator_1.CompOperator {
7
- constructor(left, right) {
8
- super(left, right);
9
- this._operatorType = enums_1.OperatorType.lt;
10
- this._symbol = '<';
11
- }
12
- }
13
- exports.OpLt = OpLt;
@@ -1,8 +0,0 @@
1
- import { CompOperator } from './CompOperator';
2
- import { OperatorType } from '../../enums';
3
- import { Serializable } from '../../Serializable';
4
- export declare class OpLte extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: string | Serializable, right?: any);
8
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpLte = void 0;
4
- const CompOperator_1 = require("./CompOperator");
5
- const enums_1 = require("../../enums");
6
- class OpLte extends CompOperator_1.CompOperator {
7
- constructor(left, right) {
8
- super(left, right);
9
- this._operatorType = enums_1.OperatorType.lte;
10
- this._symbol = '<=';
11
- }
12
- }
13
- exports.OpLte = OpLte;
@@ -1,8 +0,0 @@
1
- import { CompOperator } from './CompOperator';
2
- import { OperatorType } from '../../enums';
3
- import { Serializable } from '../../Serializable';
4
- export declare class OpNe extends CompOperator {
5
- _operatorType: OperatorType;
6
- _symbol: string;
7
- constructor(left: string | Serializable, right?: any);
8
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpNe = void 0;
4
- const CompOperator_1 = require("./CompOperator");
5
- const enums_1 = require("../../enums");
6
- class OpNe extends CompOperator_1.CompOperator {
7
- constructor(left, right) {
8
- super(left, right);
9
- this._operatorType = enums_1.OperatorType.ne;
10
- this._symbol = '!=';
11
- }
12
- }
13
- exports.OpNe = OpNe;
@@ -1,6 +0,0 @@
1
- import { OperatorType } from '../../enums';
2
- import { OpBetween } from './OpBetween';
3
- export declare class OpNotBetween extends OpBetween {
4
- _operatorType: OperatorType;
5
- _symbol: string;
6
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpNotBetween = void 0;
4
- const enums_1 = require("../../enums");
5
- const OpBetween_1 = require("./OpBetween");
6
- class OpNotBetween extends OpBetween_1.OpBetween {
7
- constructor() {
8
- super(...arguments);
9
- this._operatorType = enums_1.OperatorType.notBetween;
10
- this._symbol = 'not between';
11
- }
12
- }
13
- exports.OpNotBetween = OpNotBetween;
@@ -1,6 +0,0 @@
1
- import { OperatorType } from '../../enums';
2
- import { OpExists } from './OpExists';
3
- export declare class OpNotExists extends OpExists {
4
- _operatorType: OperatorType;
5
- _symbol: string;
6
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpNotExists = void 0;
4
- const enums_1 = require("../../enums");
5
- const OpExists_1 = require("./OpExists");
6
- class OpNotExists extends OpExists_1.OpExists {
7
- constructor() {
8
- super(...arguments);
9
- this._operatorType = enums_1.OperatorType.notExists;
10
- this._symbol = 'not exists';
11
- }
12
- }
13
- exports.OpNotExists = OpNotExists;
@@ -1,6 +0,0 @@
1
- import { OperatorType } from '../../enums';
2
- import { OpILike } from './OpILike';
3
- export declare class OpNotILike extends OpILike {
4
- _operatorType: OperatorType;
5
- _symbol: string;
6
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OpNotILike = void 0;
4
- const enums_1 = require("../../enums");
5
- const OpILike_1 = require("./OpILike");
6
- class OpNotILike extends OpILike_1.OpILike {
7
- constructor() {
8
- super(...arguments);
9
- this._operatorType = enums_1.OperatorType.notILike;
10
- this._symbol = 'not ilike';
11
- }
12
- }
13
- exports.OpNotILike = OpNotILike;