@sqb/builder 4.19.6 → 4.20.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/extensions.js +2 -2
- package/cjs/query/delete-query.js +2 -0
- package/cjs/query/insert-query.js +2 -0
- package/cjs/query/query.js +1 -0
- package/cjs/query/returning-query.js +1 -0
- package/cjs/query/select-query.js +10 -0
- package/cjs/query/union-query.js +2 -0
- package/cjs/query/update-query.js +3 -0
- package/cjs/serialize-context.js +68 -58
- package/cjs/sql-objects/base-field.js +4 -4
- package/cjs/sql-objects/case-statement.js +4 -0
- package/cjs/sql-objects/coalesce-statement.js +2 -0
- package/cjs/sql-objects/count-statement.js +1 -0
- package/cjs/sql-objects/expression.js +3 -0
- package/cjs/sql-objects/field-expression.js +1 -0
- package/cjs/sql-objects/join-statement.js +3 -1
- package/cjs/sql-objects/lower-statement.js +2 -0
- package/cjs/sql-objects/max-statement.js +2 -0
- package/cjs/sql-objects/min-statement.js +2 -0
- package/cjs/sql-objects/operators/comp-operator.js +4 -0
- package/cjs/sql-objects/operators/logical-operator.js +1 -1
- package/cjs/sql-objects/operators/op-and.js +1 -4
- package/cjs/sql-objects/operators/op-between.js +2 -2
- package/cjs/sql-objects/operators/op-eq.js +2 -2
- package/cjs/sql-objects/operators/op-exists.js +2 -2
- package/cjs/sql-objects/operators/op-gt.js +2 -2
- package/cjs/sql-objects/operators/op-gte.js +2 -2
- package/cjs/sql-objects/operators/op-ilike.js +2 -5
- package/cjs/sql-objects/operators/op-in.js +2 -2
- package/cjs/sql-objects/operators/op-is-not.js +2 -2
- package/cjs/sql-objects/operators/op-is.js +2 -2
- package/cjs/sql-objects/operators/op-like.js +2 -2
- package/cjs/sql-objects/operators/op-lt.js +2 -2
- package/cjs/sql-objects/operators/op-lte.js +2 -2
- package/cjs/sql-objects/operators/op-ne.js +2 -2
- package/cjs/sql-objects/operators/op-not-between.js +2 -5
- package/cjs/sql-objects/operators/op-not-exists.js +2 -5
- package/cjs/sql-objects/operators/op-not-ilike.js +2 -5
- package/cjs/sql-objects/operators/op-not-in.js +2 -5
- package/cjs/sql-objects/operators/op-not-like.js +2 -5
- package/cjs/sql-objects/operators/op-not.js +2 -1
- package/cjs/sql-objects/operators/op-or.js +1 -4
- package/cjs/sql-objects/order-column.js +1 -0
- package/cjs/sql-objects/param-expression.js +3 -0
- package/cjs/sql-objects/raw-statement.js +1 -0
- package/cjs/sql-objects/returning-column.js +1 -0
- package/cjs/sql-objects/sequence-getter-statement.js +3 -0
- package/cjs/sql-objects/string-agg-statement.js +4 -0
- package/cjs/sql-objects/table-name.js +3 -0
- package/cjs/sql-objects/upper-statement.js +2 -0
- package/esm/extensions.js +2 -2
- package/esm/query/delete-query.js +2 -0
- package/esm/query/insert-query.js +2 -0
- package/esm/query/query.js +1 -0
- package/esm/query/returning-query.js +1 -0
- package/esm/query/select-query.js +10 -0
- package/esm/query/union-query.js +2 -0
- package/esm/query/update-query.js +3 -0
- package/esm/serialize-context.js +68 -58
- package/esm/sql-objects/base-field.js +4 -4
- package/esm/sql-objects/case-statement.js +4 -0
- package/esm/sql-objects/coalesce-statement.js +2 -0
- package/esm/sql-objects/count-statement.js +1 -0
- package/esm/sql-objects/expression.js +3 -0
- package/esm/sql-objects/field-expression.js +1 -0
- package/esm/sql-objects/join-statement.js +3 -1
- package/esm/sql-objects/lower-statement.js +2 -0
- package/esm/sql-objects/max-statement.js +2 -0
- package/esm/sql-objects/min-statement.js +2 -0
- package/esm/sql-objects/operators/comp-operator.js +4 -0
- package/esm/sql-objects/operators/logical-operator.js +1 -1
- package/esm/sql-objects/operators/op-and.js +1 -4
- package/esm/sql-objects/operators/op-between.js +2 -2
- package/esm/sql-objects/operators/op-eq.js +2 -2
- package/esm/sql-objects/operators/op-exists.js +2 -2
- package/esm/sql-objects/operators/op-gt.js +2 -2
- package/esm/sql-objects/operators/op-gte.js +2 -2
- package/esm/sql-objects/operators/op-ilike.js +2 -5
- package/esm/sql-objects/operators/op-in.js +2 -2
- package/esm/sql-objects/operators/op-is-not.js +2 -2
- package/esm/sql-objects/operators/op-is.js +2 -2
- package/esm/sql-objects/operators/op-like.js +2 -2
- package/esm/sql-objects/operators/op-lt.js +2 -2
- package/esm/sql-objects/operators/op-lte.js +2 -2
- package/esm/sql-objects/operators/op-ne.js +2 -2
- package/esm/sql-objects/operators/op-not-between.js +2 -5
- package/esm/sql-objects/operators/op-not-exists.js +2 -5
- package/esm/sql-objects/operators/op-not-ilike.js +2 -5
- package/esm/sql-objects/operators/op-not-in.js +2 -5
- package/esm/sql-objects/operators/op-not-like.js +2 -5
- package/esm/sql-objects/operators/op-not.js +2 -1
- package/esm/sql-objects/operators/op-or.js +1 -4
- package/esm/sql-objects/order-column.js +1 -0
- package/esm/sql-objects/param-expression.js +3 -0
- package/esm/sql-objects/raw-statement.js +1 -0
- package/esm/sql-objects/returning-column.js +1 -0
- package/esm/sql-objects/sequence-getter-statement.js +3 -0
- package/esm/sql-objects/string-agg-statement.js +4 -0
- package/esm/sql-objects/table-name.js +3 -0
- package/esm/sql-objects/upper-statement.js +2 -0
- package/package.json +4 -5
package/cjs/extensions.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SerializerRegistry = void 0;
|
|
4
4
|
class SerializerRegistry {
|
|
5
|
+
static serializers = [];
|
|
5
6
|
static get size() {
|
|
6
7
|
return this.serializers.length;
|
|
7
8
|
}
|
|
@@ -19,7 +20,7 @@ class SerializerRegistry {
|
|
|
19
20
|
return this.serializers.values();
|
|
20
21
|
}
|
|
21
22
|
static unRegister(...extensions) {
|
|
22
|
-
this.serializers =
|
|
23
|
+
this.serializers = this.serializers.filter(x => !extensions.includes(x));
|
|
23
24
|
}
|
|
24
25
|
static getAll(dialect) {
|
|
25
26
|
return this.serializers.filter(x => x.dialect === dialect);
|
|
@@ -35,4 +36,3 @@ class SerializerRegistry {
|
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
exports.SerializerRegistry = SerializerRegistry;
|
|
38
|
-
SerializerRegistry.serializers = [];
|
|
@@ -7,6 +7,8 @@ const table_name_js_1 = require("../sql-objects/table-name.js");
|
|
|
7
7
|
const typeguards_js_1 = require("../typeguards.js");
|
|
8
8
|
const query_js_1 = require("./query.js");
|
|
9
9
|
class DeleteQuery extends query_js_1.Query {
|
|
10
|
+
_table;
|
|
11
|
+
_where;
|
|
10
12
|
constructor(tableName) {
|
|
11
13
|
super();
|
|
12
14
|
if (!tableName ||
|
|
@@ -7,6 +7,8 @@ const table_name_js_1 = require("../sql-objects/table-name.js");
|
|
|
7
7
|
const typeguards_js_1 = require("../typeguards.js");
|
|
8
8
|
const returning_query_js_1 = require("./returning-query.js");
|
|
9
9
|
class InsertQuery extends returning_query_js_1.ReturningQuery {
|
|
10
|
+
_table;
|
|
11
|
+
_input;
|
|
10
12
|
constructor(tableName, input) {
|
|
11
13
|
super();
|
|
12
14
|
if (!tableName ||
|
package/cjs/query/query.js
CHANGED
|
@@ -8,6 +8,7 @@ const putil_merge_1 = tslib_1.__importDefault(require("putil-merge"));
|
|
|
8
8
|
const serializable_js_1 = require("../serializable.js");
|
|
9
9
|
const serialize_context_js_1 = require("../serialize-context.js");
|
|
10
10
|
class Query extends serializable_js_1.Serializable {
|
|
11
|
+
_params;
|
|
11
12
|
constructor() {
|
|
12
13
|
super();
|
|
13
14
|
events_1.EventEmitter.call(this);
|
|
@@ -12,6 +12,16 @@ const table_name_js_1 = require("../sql-objects/table-name.js");
|
|
|
12
12
|
const typeguards_js_1 = require("../typeguards.js");
|
|
13
13
|
const query_js_1 = require("./query.js");
|
|
14
14
|
class SelectQuery extends query_js_1.Query {
|
|
15
|
+
_tables;
|
|
16
|
+
_columns;
|
|
17
|
+
_joins;
|
|
18
|
+
_where;
|
|
19
|
+
_groupBy;
|
|
20
|
+
_orderBy;
|
|
21
|
+
_limit;
|
|
22
|
+
_offset;
|
|
23
|
+
_alias;
|
|
24
|
+
_distinct;
|
|
15
25
|
constructor(...column) {
|
|
16
26
|
super();
|
|
17
27
|
if (column.length)
|
package/cjs/query/union-query.js
CHANGED
|
@@ -8,6 +8,9 @@ const table_name_js_1 = require("../sql-objects/table-name.js");
|
|
|
8
8
|
const typeguards_js_1 = require("../typeguards.js");
|
|
9
9
|
const returning_query_js_1 = require("./returning-query.js");
|
|
10
10
|
class UpdateQuery extends returning_query_js_1.ReturningQuery {
|
|
11
|
+
_table;
|
|
12
|
+
_input;
|
|
13
|
+
_where;
|
|
11
14
|
constructor(tableName, input) {
|
|
12
15
|
super();
|
|
13
16
|
if (!tableName ||
|
package/cjs/serialize-context.js
CHANGED
|
@@ -6,65 +6,75 @@ const extensions_js_1 = require("./extensions.js");
|
|
|
6
6
|
const serializable_js_1 = require("./serializable.js");
|
|
7
7
|
const typeguards_js_1 = require("./typeguards.js");
|
|
8
8
|
class SerializeContext {
|
|
9
|
+
reservedWords = [
|
|
10
|
+
'schema',
|
|
11
|
+
'table',
|
|
12
|
+
'field',
|
|
13
|
+
'index',
|
|
14
|
+
'foreign',
|
|
15
|
+
'key',
|
|
16
|
+
'select',
|
|
17
|
+
'insert',
|
|
18
|
+
'update',
|
|
19
|
+
'delete',
|
|
20
|
+
'with',
|
|
21
|
+
'merge',
|
|
22
|
+
'join',
|
|
23
|
+
'inner',
|
|
24
|
+
'outer',
|
|
25
|
+
'left',
|
|
26
|
+
'right',
|
|
27
|
+
'full',
|
|
28
|
+
'from',
|
|
29
|
+
'where',
|
|
30
|
+
'order',
|
|
31
|
+
'by',
|
|
32
|
+
'group',
|
|
33
|
+
'having',
|
|
34
|
+
'acs',
|
|
35
|
+
'ascending',
|
|
36
|
+
'dsc',
|
|
37
|
+
'descending',
|
|
38
|
+
'distinct',
|
|
39
|
+
'and',
|
|
40
|
+
'or',
|
|
41
|
+
'not',
|
|
42
|
+
'between',
|
|
43
|
+
'null',
|
|
44
|
+
'like',
|
|
45
|
+
'ilike',
|
|
46
|
+
'count',
|
|
47
|
+
'sum',
|
|
48
|
+
'average',
|
|
49
|
+
'avg',
|
|
50
|
+
'cascade',
|
|
51
|
+
'authorization',
|
|
52
|
+
'create',
|
|
53
|
+
'add',
|
|
54
|
+
'drop',
|
|
55
|
+
'alter',
|
|
56
|
+
'index',
|
|
57
|
+
'private',
|
|
58
|
+
'sequence',
|
|
59
|
+
'default',
|
|
60
|
+
'constraint',
|
|
61
|
+
'references',
|
|
62
|
+
'primary',
|
|
63
|
+
'foreign',
|
|
64
|
+
'user',
|
|
65
|
+
'password',
|
|
66
|
+
];
|
|
67
|
+
dialect;
|
|
68
|
+
prettyPrint;
|
|
69
|
+
params;
|
|
70
|
+
dialectVersion;
|
|
71
|
+
strictParams;
|
|
72
|
+
serializeHooks;
|
|
73
|
+
paramOptions;
|
|
74
|
+
preparedParams;
|
|
75
|
+
returningFields;
|
|
76
|
+
strictParamGenId;
|
|
9
77
|
constructor(opts) {
|
|
10
|
-
this.reservedWords = [
|
|
11
|
-
'schema',
|
|
12
|
-
'table',
|
|
13
|
-
'field',
|
|
14
|
-
'index',
|
|
15
|
-
'foreign',
|
|
16
|
-
'key',
|
|
17
|
-
'select',
|
|
18
|
-
'insert',
|
|
19
|
-
'update',
|
|
20
|
-
'delete',
|
|
21
|
-
'with',
|
|
22
|
-
'merge',
|
|
23
|
-
'join',
|
|
24
|
-
'inner',
|
|
25
|
-
'outer',
|
|
26
|
-
'left',
|
|
27
|
-
'right',
|
|
28
|
-
'full',
|
|
29
|
-
'from',
|
|
30
|
-
'where',
|
|
31
|
-
'order',
|
|
32
|
-
'by',
|
|
33
|
-
'group',
|
|
34
|
-
'having',
|
|
35
|
-
'acs',
|
|
36
|
-
'ascending',
|
|
37
|
-
'dsc',
|
|
38
|
-
'descending',
|
|
39
|
-
'distinct',
|
|
40
|
-
'and',
|
|
41
|
-
'or',
|
|
42
|
-
'not',
|
|
43
|
-
'between',
|
|
44
|
-
'null',
|
|
45
|
-
'like',
|
|
46
|
-
'ilike',
|
|
47
|
-
'count',
|
|
48
|
-
'sum',
|
|
49
|
-
'average',
|
|
50
|
-
'avg',
|
|
51
|
-
'cascade',
|
|
52
|
-
'authorization',
|
|
53
|
-
'create',
|
|
54
|
-
'add',
|
|
55
|
-
'drop',
|
|
56
|
-
'alter',
|
|
57
|
-
'index',
|
|
58
|
-
'private',
|
|
59
|
-
'sequence',
|
|
60
|
-
'default',
|
|
61
|
-
'constraint',
|
|
62
|
-
'references',
|
|
63
|
-
'primary',
|
|
64
|
-
'foreign',
|
|
65
|
-
'user',
|
|
66
|
-
'password',
|
|
67
|
-
];
|
|
68
78
|
if (opts)
|
|
69
79
|
Object.assign(this, opts);
|
|
70
80
|
}
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BaseField = void 0;
|
|
4
4
|
const expression_js_1 = require("./expression.js");
|
|
5
5
|
class BaseField extends expression_js_1.Expression {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
_field = '';
|
|
7
|
+
_schema;
|
|
8
|
+
_table;
|
|
9
|
+
_descending;
|
|
10
10
|
}
|
|
11
11
|
exports.BaseField = BaseField;
|
|
@@ -5,6 +5,10 @@ const enums_js_1 = require("../enums.js");
|
|
|
5
5
|
const serializable_js_1 = require("../serializable.js");
|
|
6
6
|
const op_and_js_1 = require("./operators/op-and.js");
|
|
7
7
|
class CaseStatement extends serializable_js_1.Serializable {
|
|
8
|
+
_expressions;
|
|
9
|
+
_elseValue;
|
|
10
|
+
_condition;
|
|
11
|
+
_alias;
|
|
8
12
|
constructor() {
|
|
9
13
|
super();
|
|
10
14
|
this._expressions = [];
|
|
@@ -4,6 +4,8 @@ exports.CoalesceStatement = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../enums.js");
|
|
5
5
|
const serializable_js_1 = require("../serializable.js");
|
|
6
6
|
class CoalesceStatement extends serializable_js_1.Serializable {
|
|
7
|
+
_expressions;
|
|
8
|
+
_alias;
|
|
7
9
|
constructor(...expressions) {
|
|
8
10
|
super();
|
|
9
11
|
this._expressions = expressions;
|
|
@@ -4,6 +4,7 @@ exports.CountStatement = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../enums.js");
|
|
5
5
|
const serializable_js_1 = require("../serializable.js");
|
|
6
6
|
class CountStatement extends serializable_js_1.Serializable {
|
|
7
|
+
_alias;
|
|
7
8
|
get _type() {
|
|
8
9
|
return enums_js_1.SerializationType.COUNT_STATEMENT;
|
|
9
10
|
}
|
|
@@ -3,5 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Expression = void 0;
|
|
4
4
|
const serializable_js_1 = require("../serializable.js");
|
|
5
5
|
class Expression extends serializable_js_1.Serializable {
|
|
6
|
+
_dataType;
|
|
7
|
+
_isArray;
|
|
8
|
+
_isDataSet;
|
|
6
9
|
}
|
|
7
10
|
exports.Expression = Expression;
|
|
@@ -5,6 +5,7 @@ const enums_js_1 = require("../enums.js");
|
|
|
5
5
|
const base_field_js_1 = require("./base-field.js");
|
|
6
6
|
const TABLE_COLUMN_PATTERN = /^((?:[a-zA-Z_][\w$_]*\.){0,2}) *([0-9a-zA-Z_][\w$_]*|\*) *(?:as)? *([a-zA-Z_][\w$_]*)?$/;
|
|
7
7
|
class FieldExpression extends base_field_js_1.BaseField {
|
|
8
|
+
_alias;
|
|
8
9
|
constructor(arg0, arg1, arg2) {
|
|
9
10
|
super();
|
|
10
11
|
let expression;
|
|
@@ -7,9 +7,11 @@ const typeguards_js_1 = require("../typeguards.js");
|
|
|
7
7
|
const op_and_js_1 = require("./operators/op-and.js");
|
|
8
8
|
const table_name_js_1 = require("./table-name.js");
|
|
9
9
|
class JoinStatement extends serializable_js_1.Serializable {
|
|
10
|
+
_joinType;
|
|
11
|
+
_table;
|
|
12
|
+
_conditions = new op_and_js_1.OpAnd();
|
|
10
13
|
constructor(joinType, table) {
|
|
11
14
|
super();
|
|
12
|
-
this._conditions = new op_and_js_1.OpAnd();
|
|
13
15
|
// noinspection SuspiciousTypeOfGuard
|
|
14
16
|
if (!((0, typeguards_js_1.isSelectQuery)(table) ||
|
|
15
17
|
(0, typeguards_js_1.isRawStatement)(table) ||
|
|
@@ -4,6 +4,8 @@ exports.LowerStatement = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../enums.js");
|
|
5
5
|
const serializable_js_1 = require("../serializable.js");
|
|
6
6
|
class LowerStatement extends serializable_js_1.Serializable {
|
|
7
|
+
_expression;
|
|
8
|
+
_alias;
|
|
7
9
|
constructor(expression) {
|
|
8
10
|
super();
|
|
9
11
|
this._expression = expression;
|
|
@@ -4,6 +4,8 @@ exports.MaxStatement = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../enums.js");
|
|
5
5
|
const serializable_js_1 = require("../serializable.js");
|
|
6
6
|
class MaxStatement extends serializable_js_1.Serializable {
|
|
7
|
+
_expression;
|
|
8
|
+
_alias;
|
|
7
9
|
constructor(expression) {
|
|
8
10
|
super();
|
|
9
11
|
this._expression = expression;
|
|
@@ -4,6 +4,8 @@ exports.MinStatement = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../enums.js");
|
|
5
5
|
const serializable_js_1 = require("../serializable.js");
|
|
6
6
|
class MinStatement extends serializable_js_1.Serializable {
|
|
7
|
+
_expression;
|
|
8
|
+
_alias;
|
|
7
9
|
constructor(expression) {
|
|
8
10
|
super();
|
|
9
11
|
this._expression = expression;
|
|
@@ -9,6 +9,10 @@ const operator_js_1 = require("../operator.js");
|
|
|
9
9
|
const param_expression_js_1 = require("../param-expression.js");
|
|
10
10
|
const EXPRESSION_PATTERN = /^([\w\\.$]+)(\[])?/;
|
|
11
11
|
class CompOperator extends operator_js_1.Operator {
|
|
12
|
+
_left;
|
|
13
|
+
_right;
|
|
14
|
+
_symbol;
|
|
15
|
+
_isArray;
|
|
12
16
|
constructor(left, right) {
|
|
13
17
|
super();
|
|
14
18
|
if (typeof left === 'string') {
|
|
@@ -11,9 +11,9 @@ exports.WrapOps = {};
|
|
|
11
11
|
// noinspection RegExpUnnecessaryNonCapturingGroup
|
|
12
12
|
const COMPARE_LEFT_PATTERN = /^([\w\\.$]+(?:\[])?) *(.*)$/;
|
|
13
13
|
class LogicalOperator extends operator_js_1.Operator {
|
|
14
|
+
_items = [];
|
|
14
15
|
constructor(...expressions) {
|
|
15
16
|
super();
|
|
16
|
-
this._items = [];
|
|
17
17
|
this.add(...expressions);
|
|
18
18
|
}
|
|
19
19
|
get _type() {
|
|
@@ -4,9 +4,6 @@ exports.OpAnd = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const logical_operator_js_1 = require("./logical-operator.js");
|
|
6
6
|
class OpAnd extends logical_operator_js_1.LogicalOperator {
|
|
7
|
-
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.and;
|
|
10
|
-
}
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.and;
|
|
11
8
|
}
|
|
12
9
|
exports.OpAnd = OpAnd;
|
|
@@ -4,10 +4,10 @@ exports.OpBetween = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
6
|
class OpBetween extends comp_operator_js_1.CompOperator {
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.between;
|
|
8
|
+
_symbol = 'between';
|
|
7
9
|
constructor(left, right) {
|
|
8
10
|
super(left, right);
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.between;
|
|
10
|
-
this._symbol = 'between';
|
|
11
11
|
if (right && right[1] == null)
|
|
12
12
|
right[1] = right[0];
|
|
13
13
|
}
|
|
@@ -4,10 +4,10 @@ exports.OpEq = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
6
|
class OpEq extends comp_operator_js_1.CompOperator {
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.eq;
|
|
8
|
+
_symbol = '=';
|
|
7
9
|
constructor(left, right) {
|
|
8
10
|
super(left, right);
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.eq;
|
|
10
|
-
this._symbol = '=';
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
exports.OpEq = OpEq;
|
|
@@ -5,10 +5,10 @@ const enums_js_1 = require("../../enums.js");
|
|
|
5
5
|
const typeguards_js_1 = require("../../typeguards.js");
|
|
6
6
|
const comp_operator_js_1 = require("./comp-operator.js");
|
|
7
7
|
class OpExists extends comp_operator_js_1.CompOperator {
|
|
8
|
+
_operatorType = enums_js_1.OperatorType.exists;
|
|
9
|
+
_symbol = 'exists';
|
|
8
10
|
constructor(query) {
|
|
9
11
|
super(query);
|
|
10
|
-
this._operatorType = enums_js_1.OperatorType.exists;
|
|
11
|
-
this._symbol = 'exists';
|
|
12
12
|
if (!(typeof query === 'object' && (0, typeguards_js_1.isSelectQuery)(query))) {
|
|
13
13
|
throw new TypeError('You must provide a SelectQuery in `exists()`');
|
|
14
14
|
}
|
|
@@ -4,10 +4,10 @@ exports.OpGt = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
6
|
class OpGt extends comp_operator_js_1.CompOperator {
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.gt;
|
|
8
|
+
_symbol = '>';
|
|
7
9
|
constructor(left, right) {
|
|
8
10
|
super(left, right);
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.gt;
|
|
10
|
-
this._symbol = '>';
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
exports.OpGt = OpGt;
|
|
@@ -4,10 +4,10 @@ exports.OpGte = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
6
|
class OpGte extends comp_operator_js_1.CompOperator {
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.gte;
|
|
8
|
+
_symbol = '>=';
|
|
7
9
|
constructor(left, right) {
|
|
8
10
|
super(left, right);
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.gte;
|
|
10
|
-
this._symbol = '>=';
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
exports.OpGte = OpGte;
|
|
@@ -4,10 +4,7 @@ exports.OpILike = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const op_like_js_1 = require("./op-like.js");
|
|
6
6
|
class OpILike extends op_like_js_1.OpLike {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.iLike;
|
|
10
|
-
this._symbol = 'ilike';
|
|
11
|
-
}
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.iLike;
|
|
8
|
+
_symbol = 'ilike';
|
|
12
9
|
}
|
|
13
10
|
exports.OpILike = OpILike;
|
|
@@ -5,10 +5,10 @@ const enums_js_1 = require("../../enums.js");
|
|
|
5
5
|
const typeguards_js_1 = require("../../typeguards.js");
|
|
6
6
|
const comp_operator_js_1 = require("./comp-operator.js");
|
|
7
7
|
class OpIn extends comp_operator_js_1.CompOperator {
|
|
8
|
+
_operatorType = enums_js_1.OperatorType.in;
|
|
9
|
+
_symbol = 'in';
|
|
8
10
|
constructor(left, right) {
|
|
9
11
|
super(left, Array.isArray(right) || (0, typeguards_js_1.isSerializable)(right) ? right : [right]);
|
|
10
|
-
this._operatorType = enums_js_1.OperatorType.in;
|
|
11
|
-
this._symbol = 'in';
|
|
12
12
|
}
|
|
13
13
|
_serialize(ctx) {
|
|
14
14
|
if (Array.isArray(this._right) && !this._right.length)
|
|
@@ -4,10 +4,10 @@ exports.OpIsNot = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
6
|
class OpIsNot extends comp_operator_js_1.CompOperator {
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.isNot;
|
|
8
|
+
_symbol = 'is not';
|
|
7
9
|
constructor(left, right) {
|
|
8
10
|
super(left, right);
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.isNot;
|
|
10
|
-
this._symbol = 'is not';
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
exports.OpIsNot = OpIsNot;
|
|
@@ -4,10 +4,10 @@ exports.OpIs = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
6
|
class OpIs extends comp_operator_js_1.CompOperator {
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.is;
|
|
8
|
+
_symbol = 'is';
|
|
7
9
|
constructor(left, right) {
|
|
8
10
|
super(left, right);
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.is;
|
|
10
|
-
this._symbol = 'is';
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
exports.OpIs = OpIs;
|
|
@@ -4,10 +4,10 @@ exports.OpLike = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
6
|
class OpLike extends comp_operator_js_1.CompOperator {
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.like;
|
|
8
|
+
_symbol = 'like';
|
|
7
9
|
constructor(left, right) {
|
|
8
10
|
super(left, right);
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.like;
|
|
10
|
-
this._symbol = 'like';
|
|
11
11
|
}
|
|
12
12
|
__serialize(ctx, o) {
|
|
13
13
|
if (!o.right.expression)
|
|
@@ -4,10 +4,10 @@ exports.OpLt = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
6
|
class OpLt extends comp_operator_js_1.CompOperator {
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.lt;
|
|
8
|
+
_symbol = '<';
|
|
7
9
|
constructor(left, right) {
|
|
8
10
|
super(left, right);
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.lt;
|
|
10
|
-
this._symbol = '<';
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
exports.OpLt = OpLt;
|
|
@@ -4,10 +4,10 @@ exports.OpLte = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
6
|
class OpLte extends comp_operator_js_1.CompOperator {
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.lte;
|
|
8
|
+
_symbol = '<=';
|
|
7
9
|
constructor(left, right) {
|
|
8
10
|
super(left, right);
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.lte;
|
|
10
|
-
this._symbol = '<=';
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
exports.OpLte = OpLte;
|
|
@@ -4,10 +4,10 @@ exports.OpNe = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const comp_operator_js_1 = require("./comp-operator.js");
|
|
6
6
|
class OpNe extends comp_operator_js_1.CompOperator {
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.ne;
|
|
8
|
+
_symbol = '!=';
|
|
7
9
|
constructor(left, right) {
|
|
8
10
|
super(left, right);
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.ne;
|
|
10
|
-
this._symbol = '!=';
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
exports.OpNe = OpNe;
|
|
@@ -4,10 +4,7 @@ exports.OpNotBetween = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const op_between_js_1 = require("./op-between.js");
|
|
6
6
|
class OpNotBetween extends op_between_js_1.OpBetween {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.notBetween;
|
|
10
|
-
this._symbol = 'not between';
|
|
11
|
-
}
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.notBetween;
|
|
8
|
+
_symbol = 'not between';
|
|
12
9
|
}
|
|
13
10
|
exports.OpNotBetween = OpNotBetween;
|
|
@@ -4,10 +4,7 @@ exports.OpNotExists = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const op_exists_js_1 = require("./op-exists.js");
|
|
6
6
|
class OpNotExists extends op_exists_js_1.OpExists {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.notExists;
|
|
10
|
-
this._symbol = 'not exists';
|
|
11
|
-
}
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.notExists;
|
|
8
|
+
_symbol = 'not exists';
|
|
12
9
|
}
|
|
13
10
|
exports.OpNotExists = OpNotExists;
|
|
@@ -4,10 +4,7 @@ exports.OpNotILike = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const op_ilike_js_1 = require("./op-ilike.js");
|
|
6
6
|
class OpNotILike extends op_ilike_js_1.OpILike {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.notILike;
|
|
10
|
-
this._symbol = 'not ilike';
|
|
11
|
-
}
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.notILike;
|
|
8
|
+
_symbol = 'not ilike';
|
|
12
9
|
}
|
|
13
10
|
exports.OpNotILike = OpNotILike;
|
|
@@ -4,10 +4,7 @@ exports.OpNotIn = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const op_in_js_1 = require("./op-in.js");
|
|
6
6
|
class OpNotIn extends op_in_js_1.OpIn {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.notIn;
|
|
10
|
-
this._symbol = 'not in';
|
|
11
|
-
}
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.notIn;
|
|
8
|
+
_symbol = 'not in';
|
|
12
9
|
}
|
|
13
10
|
exports.OpNotIn = OpNotIn;
|
|
@@ -4,10 +4,7 @@ exports.OpNotLike = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const op_like_js_1 = require("./op-like.js");
|
|
6
6
|
class OpNotLike extends op_like_js_1.OpLike {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.notLike;
|
|
10
|
-
this._symbol = 'not like';
|
|
11
|
-
}
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.notLike;
|
|
8
|
+
_symbol = 'not like';
|
|
12
9
|
}
|
|
13
10
|
exports.OpNotLike = OpNotLike;
|
|
@@ -4,9 +4,10 @@ exports.OpNot = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const operator_js_1 = require("../operator.js");
|
|
6
6
|
class OpNot extends operator_js_1.Operator {
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.not;
|
|
8
|
+
_expression;
|
|
7
9
|
constructor(expression) {
|
|
8
10
|
super();
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.not;
|
|
10
11
|
this._expression = expression;
|
|
11
12
|
}
|
|
12
13
|
get _type() {
|
|
@@ -4,9 +4,6 @@ exports.OpOr = void 0;
|
|
|
4
4
|
const enums_js_1 = require("../../enums.js");
|
|
5
5
|
const logical_operator_js_1 = require("./logical-operator.js");
|
|
6
6
|
class OpOr extends logical_operator_js_1.LogicalOperator {
|
|
7
|
-
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this._operatorType = enums_js_1.OperatorType.or;
|
|
10
|
-
}
|
|
7
|
+
_operatorType = enums_js_1.OperatorType.or;
|
|
11
8
|
}
|
|
12
9
|
exports.OpOr = OpOr;
|