@mrnafisia/type-query 1.0.53 → 1.1.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/dist/context.d.ts +56 -583
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +41 -18
- package/dist/context.js.map +1 -1
- package/dist/createModelUtils.d.ts +503 -0
- package/dist/createModelUtils.d.ts.map +1 -0
- package/dist/{model.js → createModelUtils.js} +16 -13
- package/dist/createModelUtils.js.map +1 -0
- package/dist/dictionary.d.ts +93 -10
- package/dist/dictionary.d.ts.map +1 -1
- package/dist/dictionary.js +132 -164
- package/dist/dictionary.js.map +1 -1
- package/dist/entity.d.ts +687 -2483
- package/dist/entity.d.ts.map +1 -1
- package/dist/entity.js +164 -189
- package/dist/entity.js.map +1 -1
- package/dist/hook.d.ts +15 -0
- package/dist/hook.d.ts.map +1 -0
- package/dist/hook.js +30 -0
- package/dist/hook.js.map +1 -0
- package/dist/index.d.ts +17 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -15
- package/dist/index.js.map +1 -1
- package/dist/parser.d.ts +1 -1
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +1 -1
- package/dist/parser.js.map +1 -1
- package/dist/pool.d.ts +9 -5
- package/dist/pool.d.ts.map +1 -1
- package/dist/pool.js +1 -26
- package/dist/pool.js.map +1 -1
- package/dist/schema.d.ts +21 -9
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +169 -176
- package/dist/schema.js.map +1 -1
- package/dist/testUtil.d.ts +25 -1
- package/dist/testUtil.d.ts.map +1 -1
- package/dist/testUtil.js +8 -2
- package/dist/testUtil.js.map +1 -1
- package/dist/types/Context.d.ts +53 -0
- package/dist/types/Context.d.ts.map +1 -0
- package/dist/types/{context.js → Context.js} +1 -1
- package/dist/types/Context.js.map +1 -0
- package/dist/types/Entity.d.ts +64 -0
- package/dist/types/Entity.d.ts.map +1 -0
- package/dist/types/{entity.js → Entity.js} +1 -1
- package/dist/types/Entity.js.map +1 -0
- package/dist/types/{json.d.ts → Json.d.ts} +3 -3
- package/dist/types/{json.d.ts.map → Json.d.ts.map} +1 -1
- package/dist/types/{pool.js → Json.js} +1 -1
- package/dist/types/Json.js.map +1 -0
- package/dist/types/Model.d.ts +12 -0
- package/dist/types/Model.d.ts.map +1 -0
- package/dist/types/{table.js → Model.js} +1 -1
- package/dist/types/Model.js.map +1 -0
- package/dist/types/{table.d.ts → Table.d.ts} +5 -5
- package/dist/types/{table.d.ts.map → Table.d.ts.map} +1 -1
- package/dist/types/{json.js → Table.js} +1 -1
- package/dist/types/Table.js.map +1 -0
- package/dist/types/TypeMapper.d.ts +14 -0
- package/dist/types/TypeMapper.d.ts.map +1 -0
- package/dist/types/{model.js → TypeMapper.js} +1 -1
- package/dist/types/TypeMapper.js.map +1 -0
- package/dist/types/postgres.d.ts +3 -6
- package/dist/types/postgres.d.ts.map +1 -1
- package/dist/utils.d.ts +38 -66
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +48 -171
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/U.d.ts +0 -3
- package/dist/U.d.ts.map +0 -1
- package/dist/U.js +0 -29
- package/dist/U.js.map +0 -1
- package/dist/model.d.ts +0 -1006
- package/dist/model.d.ts.map +0 -1
- package/dist/model.js.map +0 -1
- package/dist/types/context.d.ts +0 -52
- package/dist/types/context.d.ts.map +0 -1
- package/dist/types/context.js.map +0 -1
- package/dist/types/entity.d.ts +0 -71
- package/dist/types/entity.d.ts.map +0 -1
- package/dist/types/entity.js.map +0 -1
- package/dist/types/json.js.map +0 -1
- package/dist/types/model.d.ts +0 -24
- package/dist/types/model.d.ts.map +0 -1
- package/dist/types/model.js.map +0 -1
- package/dist/types/pool.d.ts +0 -19
- package/dist/types/pool.d.ts.map +0 -1
- package/dist/types/pool.js.map +0 -1
- package/dist/types/table.js.map +0 -1
- package/dist/types/testUtil.d.ts +0 -27
- package/dist/types/testUtil.d.ts.map +0 -1
- package/dist/types/testUtil.js +0 -3
- package/dist/types/testUtil.js.map +0 -1
|
@@ -34,15 +34,18 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
34
34
|
return result;
|
|
35
35
|
};
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.validateStringGenerator = exports.validateDecimalGenerator = exports.validateNumberGenerator = exports.
|
|
37
|
+
exports.createModelUtils = exports.validateStringGenerator = exports.validateDecimalGenerator = exports.validateNumberGenerator = exports.BigIntRange = exports.IntegerRange = exports.SmallIntRange = void 0;
|
|
38
38
|
var Parser = __importStar(require("./parser"));
|
|
39
39
|
var never_catch_1 = require("never-catch");
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
var
|
|
40
|
+
var SmallIntRange = { min: -32768, max: 32767 };
|
|
41
|
+
exports.SmallIntRange = SmallIntRange;
|
|
42
|
+
var IntegerRange = { min: -2147483648, max: 2147483647 };
|
|
43
|
+
exports.IntegerRange = IntegerRange;
|
|
44
|
+
var BigIntRange = {
|
|
43
45
|
min: BigInt('-9223372036854775808'),
|
|
44
46
|
max: BigInt('9223372036854775807')
|
|
45
47
|
};
|
|
48
|
+
exports.BigIntRange = BigIntRange;
|
|
46
49
|
var validateNumberGenerator = function (_a) {
|
|
47
50
|
var min = _a.min, max = _a.max;
|
|
48
51
|
if (min === undefined) {
|
|
@@ -169,20 +172,20 @@ var createModelUtils = function (columns, custom) {
|
|
|
169
172
|
switch (val.type) {
|
|
170
173
|
case 'smallint':
|
|
171
174
|
validateFun = validateNumberGenerator({
|
|
172
|
-
min: (_d = val.min) !== null && _d !== void 0 ? _d :
|
|
173
|
-
max: (_e = val.max) !== null && _e !== void 0 ? _e :
|
|
175
|
+
min: (_d = val.min) !== null && _d !== void 0 ? _d : SmallIntRange.min,
|
|
176
|
+
max: (_e = val.max) !== null && _e !== void 0 ? _e : SmallIntRange.max
|
|
174
177
|
});
|
|
175
178
|
break;
|
|
176
179
|
case 'integer':
|
|
177
180
|
validateFun = validateNumberGenerator({
|
|
178
|
-
min: (_f = val.min) !== null && _f !== void 0 ? _f :
|
|
179
|
-
max: (_g = val.max) !== null && _g !== void 0 ? _g :
|
|
181
|
+
min: (_f = val.min) !== null && _f !== void 0 ? _f : IntegerRange.min,
|
|
182
|
+
max: (_g = val.max) !== null && _g !== void 0 ? _g : IntegerRange.max
|
|
180
183
|
});
|
|
181
184
|
break;
|
|
182
185
|
case 'bigint':
|
|
183
186
|
validateFun = validateNumberGenerator({
|
|
184
|
-
min: (_h = val.min) !== null && _h !== void 0 ? _h :
|
|
185
|
-
max: (_j = val.max) !== null && _j !== void 0 ? _j :
|
|
187
|
+
min: (_h = val.min) !== null && _h !== void 0 ? _h : BigIntRange.min,
|
|
188
|
+
max: (_j = val.max) !== null && _j !== void 0 ? _j : BigIntRange.max
|
|
186
189
|
});
|
|
187
190
|
break;
|
|
188
191
|
case 'real':
|
|
@@ -228,7 +231,7 @@ var createModelUtils = function (columns, custom) {
|
|
|
228
231
|
}
|
|
229
232
|
}
|
|
230
233
|
var parseWithValidate = function (v, validate) {
|
|
231
|
-
if (validate === void 0) { validate =
|
|
234
|
+
if (validate === void 0) { validate = true; }
|
|
232
235
|
var parsedValue = parseFun(v);
|
|
233
236
|
if (validate && parsedValue !== undefined && !validateFun(parsedValue)) {
|
|
234
237
|
return undefined;
|
|
@@ -238,7 +241,7 @@ var createModelUtils = function (columns, custom) {
|
|
|
238
241
|
return [key, { Parse: parseWithValidate, Validate: validateFun }];
|
|
239
242
|
}));
|
|
240
243
|
return __assign({ Parse: function (data, requires, optionals, validate) {
|
|
241
|
-
if (validate === void 0) { validate =
|
|
244
|
+
if (validate === void 0) { validate = true; }
|
|
242
245
|
var result = {};
|
|
243
246
|
var require;
|
|
244
247
|
for (var _i = 0, requires_1 = requires; _i < requires_1.length; _i++) {
|
|
@@ -280,4 +283,4 @@ var createModelUtils = function (columns, custom) {
|
|
|
280
283
|
} }, columnsParseAndValidate);
|
|
281
284
|
};
|
|
282
285
|
exports.createModelUtils = createModelUtils;
|
|
283
|
-
//# sourceMappingURL=
|
|
286
|
+
//# sourceMappingURL=createModelUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createModelUtils.js","sourceRoot":"","sources":["../src/createModelUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAAmC;AAEnC,2CAA8C;AAI9C,IAAM,aAAa,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;AA6QzC,sCAAa;AA5QtB,IAAM,YAAY,GAAG,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC;AA4QnC,oCAAY;AA3QpC,IAAM,WAAW,GAAG;IAChB,GAAG,EAAE,MAAM,CAAC,sBAAsB,CAAC;IACnC,GAAG,EAAE,MAAM,CAAC,qBAAqB,CAAC;CACrC,CAAC;AAwQoC,kCAAW;AAtQjD,IAAM,uBAAuB,GAAG,UAAC,EAMhC;QALG,GAAG,SAAA,EACH,GAAG,SAAA;IAKH,IAAI,GAAG,KAAK,SAAS,EAAE;QACnB,IAAI,GAAG,KAAK,SAAS,EAAE;YACnB,OAAO,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC;SACrB;aAAM;YACH,OAAO,UAAC,CAAkB,IAAK,OAAA,CAAC,IAAI,GAAG,EAAR,CAAQ,CAAC;SAC3C;KACJ;SAAM;QACH,IAAI,GAAG,KAAK,SAAS,EAAE;YACnB,OAAO,UAAC,CAAkB,IAAK,OAAA,GAAG,IAAI,CAAC,EAAR,CAAQ,CAAC;SAC3C;aAAM;YACH,OAAO,UAAC,CAAkB,IAAK,OAAA,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,EAApB,CAAoB,CAAC;SACvD;KACJ;AACL,CAAC,CAAC;AAmPO,0DAAuB;AAlPhC,IAAM,wBAAwB,GAAG,UAAC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AI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,QAAS,CAAC,IAAI,CAAC,OAAO,CAAQ,CAAC,EAAE;oBACnE,OAAO,IAAA,iBAAG,EAAC,OAAO,CAAC,CAAC;iBACvB;aACJ;YACD,OAAO,IAAA,gBAAE,EAAC,SAAS,CAAC,CAAC;QACzB,CAAC,IACG,uBAA+B,EACrC;AACN,CAAC,CAAC;AAIwB,4CAAgB"}
|
package/dist/dictionary.d.ts
CHANGED
|
@@ -1,13 +1,96 @@
|
|
|
1
|
-
import type { JoinType } from './types/
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
4
|
-
import type { TransactionIsolationLevel } from './types/pool';
|
|
1
|
+
import type { JoinType } from './types/Entity';
|
|
2
|
+
import type { ReferenceActions } from './types/Table';
|
|
3
|
+
import type { TransactionIsolationLevel } from './pool';
|
|
5
4
|
import type { OrderDirection, PostgresType } from './types/postgres';
|
|
5
|
+
type ReservedExpressionKey = (typeof ReservedExpressionKeys)[Exclude<keyof typeof ReservedExpressionKeys, keyof unknown[]>];
|
|
6
|
+
declare const ReservedExpressionKeys: readonly ["val", "=n", "!=n", "=t", "=f", "not", "+", "-", "*", "/", "||", "and", "or", "**", "fun", "swt", "col", "raw", "=", "!=", ">", ">=", "<", "<=", "lk", "@>", "<@", "?", "j-", "in", "nin", "lka", "lks", "?|", "?&", "j-a", "bt", "qry", "exists"];
|
|
7
|
+
declare const TransactionIsolationLevelDic: {
|
|
8
|
+
readonly 'read-committed': "READ COMMITTED";
|
|
9
|
+
readonly 'read-uncommitted': "READ UNCOMMITTED";
|
|
10
|
+
readonly 'repeatable-read': "REPEATABLE READ";
|
|
11
|
+
readonly serializable: "SERIALIZABLE";
|
|
12
|
+
};
|
|
6
13
|
declare const toTransactionMode: (isolationLevel: TransactionIsolationLevel, readOnly: boolean) => string;
|
|
7
|
-
declare const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare const
|
|
12
|
-
|
|
14
|
+
declare const OrderDirectionDic: {
|
|
15
|
+
readonly asc: "ASC";
|
|
16
|
+
readonly desc: "DESC";
|
|
17
|
+
};
|
|
18
|
+
declare const toOrderDirection: (dir: OrderDirection) => "ASC" | "DESC";
|
|
19
|
+
declare const JoinTypDic: {
|
|
20
|
+
readonly inner: "INNER JOIN";
|
|
21
|
+
readonly left: "LEFT OUTER JOIN";
|
|
22
|
+
readonly right: "RIGHT OUTER JOIN";
|
|
23
|
+
readonly full: "FULL OUTER JOIN";
|
|
24
|
+
};
|
|
25
|
+
declare const toJoinType: (joinType: JoinType) => "INNER JOIN" | "LEFT OUTER JOIN" | "RIGHT OUTER JOIN" | "FULL OUTER JOIN";
|
|
26
|
+
declare const PostgresTypeDic: {
|
|
27
|
+
readonly boolean: "boolean";
|
|
28
|
+
readonly smallint: "smallint";
|
|
29
|
+
readonly integer: "integer";
|
|
30
|
+
readonly bigint: "bigint";
|
|
31
|
+
readonly real: "real";
|
|
32
|
+
readonly 'double precision': "double precision";
|
|
33
|
+
readonly numeric: "numeric";
|
|
34
|
+
readonly character: "character";
|
|
35
|
+
readonly 'character varying': "character varying";
|
|
36
|
+
readonly text: "text";
|
|
37
|
+
readonly uuid: "uuid";
|
|
38
|
+
readonly date: "date";
|
|
39
|
+
readonly 'timestamp without time zone': "timestamp without time zone";
|
|
40
|
+
readonly 'timestamp with time zone': "timestamp with time zone";
|
|
41
|
+
readonly json: "json";
|
|
42
|
+
readonly jsonb: "jsonb";
|
|
43
|
+
};
|
|
44
|
+
declare const toPostgresType: (type: PostgresType) => "bigint" | "boolean" | "smallint" | "integer" | "real" | "double precision" | "numeric" | "character" | "character varying" | "text" | "uuid" | "date" | "timestamp without time zone" | "timestamp with time zone" | "json" | "jsonb";
|
|
45
|
+
declare const ReferenceActionDic: {
|
|
46
|
+
readonly 'no-action': "NO ACTION";
|
|
47
|
+
readonly restrict: "RESTRICT";
|
|
48
|
+
readonly 'set-null': "SET NULL";
|
|
49
|
+
readonly 'set-Default': "SET DEFAULT";
|
|
50
|
+
readonly cascade: "CASCADE";
|
|
51
|
+
};
|
|
52
|
+
declare const toReferenceAction: (action: ReferenceActions) => "NO ACTION" | "RESTRICT" | "SET NULL" | "SET DEFAULT" | "CASCADE";
|
|
53
|
+
declare const ReservedExpressionKeyDescriptionDic: {
|
|
54
|
+
readonly val: "wrapped value";
|
|
55
|
+
readonly '=n': "is null";
|
|
56
|
+
readonly '!=n': "is not null";
|
|
57
|
+
readonly '=t': "is true";
|
|
58
|
+
readonly '=f': "is false";
|
|
59
|
+
readonly not: "not of";
|
|
60
|
+
readonly '+': "sum";
|
|
61
|
+
readonly '-': "minus";
|
|
62
|
+
readonly '*': "multiply";
|
|
63
|
+
readonly '/': "divide";
|
|
64
|
+
readonly '||': "concat";
|
|
65
|
+
readonly and: "logical and";
|
|
66
|
+
readonly or: "logical or";
|
|
67
|
+
readonly '**': "power";
|
|
68
|
+
readonly fun: "function";
|
|
69
|
+
readonly swt: "switch statement";
|
|
70
|
+
readonly col: "column";
|
|
71
|
+
readonly raw: "raw statement";
|
|
72
|
+
readonly '=': "is equal";
|
|
73
|
+
readonly '!=': "is not equal";
|
|
74
|
+
readonly '>': "is greater than";
|
|
75
|
+
readonly '>=': "is greater-equal than";
|
|
76
|
+
readonly '<': "is less than";
|
|
77
|
+
readonly '<=': "is less-equal than";
|
|
78
|
+
readonly lk: "does like";
|
|
79
|
+
readonly '@>': "json-contain (@>)";
|
|
80
|
+
readonly '<@': "json-contain (<@)";
|
|
81
|
+
readonly '?': "json-exist (?)";
|
|
82
|
+
readonly 'j-': "json-subtract (-)";
|
|
83
|
+
readonly in: "is inside of";
|
|
84
|
+
readonly nin: "is not inside of";
|
|
85
|
+
readonly lka: "does like all";
|
|
86
|
+
readonly lks: "does like some";
|
|
87
|
+
readonly '?|': "json-does some exist (?|)";
|
|
88
|
+
readonly '?&': "json-does all exist (?&)";
|
|
89
|
+
readonly 'j-a': "json-subtract all (-)";
|
|
90
|
+
readonly bt: "is between";
|
|
91
|
+
readonly qry: "sub-query";
|
|
92
|
+
readonly exists: "row exists in sub-query";
|
|
93
|
+
};
|
|
94
|
+
declare const toReservedExpressionKeyDescription: (key: ReservedExpressionKey) => "function" | "concat" | "wrapped value" | "is null" | "is not null" | "is true" | "is false" | "not of" | "sum" | "minus" | "multiply" | "divide" | "logical and" | "logical or" | "power" | "switch statement" | "column" | "raw statement" | "is equal" | "is not equal" | "is greater than" | "is greater-equal than" | "is less than" | "is less-equal than" | "does like" | "json-contain (@>)" | "json-contain (<@)" | "json-exist (?)" | "json-subtract (-)" | "is inside of" | "is not inside of" | "does like all" | "does like some" | "json-does some exist (?|)" | "json-does all exist (?&)" | "json-subtract all (-)" | "is between" | "sub-query" | "row exists in sub-query";
|
|
95
|
+
export { type ReservedExpressionKey, ReservedExpressionKeys, TransactionIsolationLevelDic, toTransactionMode, OrderDirectionDic, toOrderDirection, JoinTypDic, toJoinType, PostgresTypeDic, toPostgresType, ReferenceActionDic, toReferenceAction, ReservedExpressionKeyDescriptionDic, toReservedExpressionKeyDescription };
|
|
13
96
|
//# sourceMappingURL=dictionary.d.ts.map
|
package/dist/dictionary.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../src/dictionary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../src/dictionary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErE,KAAK,qBAAqB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,OAAO,CAChE,MAAM,OAAO,sBAAsB,EACnC,MAAM,OAAO,EAAE,CAClB,CAAC,CAAC;AACH,QAAA,MAAM,sBAAsB,8PAwClB,CAAC;AAEX,QAAA,MAAM,4BAA4B;;;;;CAKxB,CAAC;AACX,QAAA,MAAM,iBAAiB,mBAAoB,yBAAyB,YAAY,OAAO,WACK,CAAC;AAE7F,QAAA,MAAM,iBAAiB;;;CAGb,CAAC;AACX,QAAA,MAAM,gBAAgB,QAAS,cAAc,mBAA2B,CAAC;AAEzE,QAAA,MAAM,UAAU;;;;;CAKN,CAAC;AACX,QAAA,MAAM,UAAU,aAAc,QAAQ,8EAAyB,CAAC;AAEhE,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;CAiBX,CAAC;AACX,QAAA,MAAM,cAAc,SAAU,YAAY,2OAA0B,CAAC;AAErE,QAAA,MAAM,kBAAkB;;;;;;CAMd,CAAC;AACX,QAAA,MAAM,iBAAiB,WAAY,gBAAgB,sEAA+B,CAAC;AAEnF,QAAA,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwC/B,CAAC;AACX,QAAA,MAAM,kCAAkC,QAAS,qBAAqB,iqBAA6C,CAAC;AAEpH,OAAO,EACH,KAAK,qBAAqB,EAC1B,sBAAsB,EACtB,4BAA4B,EAC5B,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,mCAAmC,EACnC,kCAAkC,EACrC,CAAC"}
|
package/dist/dictionary.js
CHANGED
|
@@ -1,180 +1,148 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toReservedExpressionKeyDescription = exports.toReferenceAction = exports.toPostgresType = exports.toJoinType = exports.toOrderDirection = exports.toTransactionMode = void 0;
|
|
3
|
+
exports.toReservedExpressionKeyDescription = exports.ReservedExpressionKeyDescriptionDic = exports.toReferenceAction = exports.ReferenceActionDic = exports.toPostgresType = exports.PostgresTypeDic = exports.toJoinType = exports.JoinTypDic = exports.toOrderDirection = exports.OrderDirectionDic = exports.toTransactionMode = exports.TransactionIsolationLevelDic = exports.ReservedExpressionKeys = void 0;
|
|
4
|
+
var ReservedExpressionKeys = [
|
|
5
|
+
'val',
|
|
6
|
+
'=n',
|
|
7
|
+
'!=n',
|
|
8
|
+
'=t',
|
|
9
|
+
'=f',
|
|
10
|
+
'not',
|
|
11
|
+
'+',
|
|
12
|
+
'-',
|
|
13
|
+
'*',
|
|
14
|
+
'/',
|
|
15
|
+
'||',
|
|
16
|
+
'and',
|
|
17
|
+
'or',
|
|
18
|
+
'**',
|
|
19
|
+
'fun',
|
|
20
|
+
'swt',
|
|
21
|
+
'col',
|
|
22
|
+
'raw',
|
|
23
|
+
'=',
|
|
24
|
+
'!=',
|
|
25
|
+
'>',
|
|
26
|
+
'>=',
|
|
27
|
+
'<',
|
|
28
|
+
'<=',
|
|
29
|
+
'lk',
|
|
30
|
+
'@>',
|
|
31
|
+
'<@',
|
|
32
|
+
'?',
|
|
33
|
+
'j-',
|
|
34
|
+
'in',
|
|
35
|
+
'nin',
|
|
36
|
+
'lka',
|
|
37
|
+
'lks',
|
|
38
|
+
'?|',
|
|
39
|
+
'?&',
|
|
40
|
+
'j-a',
|
|
41
|
+
'bt',
|
|
42
|
+
'qry',
|
|
43
|
+
'exists'
|
|
44
|
+
];
|
|
45
|
+
exports.ReservedExpressionKeys = ReservedExpressionKeys;
|
|
46
|
+
var TransactionIsolationLevelDic = {
|
|
47
|
+
'read-committed': 'READ COMMITTED',
|
|
48
|
+
'read-uncommitted': 'READ UNCOMMITTED',
|
|
49
|
+
'repeatable-read': 'REPEATABLE READ',
|
|
50
|
+
serializable: 'SERIALIZABLE'
|
|
51
|
+
};
|
|
52
|
+
exports.TransactionIsolationLevelDic = TransactionIsolationLevelDic;
|
|
4
53
|
var toTransactionMode = function (isolationLevel, readOnly) {
|
|
5
|
-
|
|
6
|
-
switch (isolationLevel) {
|
|
7
|
-
case 'read-committed':
|
|
8
|
-
result = 'READ COMMITTED';
|
|
9
|
-
break;
|
|
10
|
-
case 'read-uncommitted':
|
|
11
|
-
result = 'READ UNCOMMITTED';
|
|
12
|
-
break;
|
|
13
|
-
case 'repeatable-read':
|
|
14
|
-
result = 'REPEATABLE READ';
|
|
15
|
-
break;
|
|
16
|
-
case 'serializable':
|
|
17
|
-
result = 'SERIALIZABLE';
|
|
18
|
-
break;
|
|
19
|
-
}
|
|
20
|
-
return result + (readOnly ? ' READ ONLY' : ' READ WRITE');
|
|
54
|
+
return TransactionIsolationLevelDic[isolationLevel] + (readOnly ? ' READ ONLY' : ' READ WRITE');
|
|
21
55
|
};
|
|
22
56
|
exports.toTransactionMode = toTransactionMode;
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return 'ASC';
|
|
27
|
-
case 'desc':
|
|
28
|
-
return 'DESC';
|
|
29
|
-
}
|
|
57
|
+
var OrderDirectionDic = {
|
|
58
|
+
asc: 'ASC',
|
|
59
|
+
desc: 'DESC'
|
|
30
60
|
};
|
|
61
|
+
exports.OrderDirectionDic = OrderDirectionDic;
|
|
62
|
+
var toOrderDirection = function (dir) { return OrderDirectionDic[dir]; };
|
|
31
63
|
exports.toOrderDirection = toOrderDirection;
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return 'LEFT OUTER JOIN';
|
|
38
|
-
case 'right':
|
|
39
|
-
return 'RIGHT OUTER JOIN';
|
|
40
|
-
case 'full':
|
|
41
|
-
return 'FULL OUTER JOIN';
|
|
42
|
-
}
|
|
64
|
+
var JoinTypDic = {
|
|
65
|
+
inner: 'INNER JOIN',
|
|
66
|
+
left: 'LEFT OUTER JOIN',
|
|
67
|
+
right: 'RIGHT OUTER JOIN',
|
|
68
|
+
full: 'FULL OUTER JOIN'
|
|
43
69
|
};
|
|
70
|
+
exports.JoinTypDic = JoinTypDic;
|
|
71
|
+
var toJoinType = function (joinType) { return JoinTypDic[joinType]; };
|
|
44
72
|
exports.toJoinType = toJoinType;
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return 'character';
|
|
63
|
-
case 'character varying':
|
|
64
|
-
return 'character varying';
|
|
65
|
-
case 'text':
|
|
66
|
-
return 'text';
|
|
67
|
-
case 'uuid':
|
|
68
|
-
return 'uuid';
|
|
69
|
-
case 'date':
|
|
70
|
-
return 'date';
|
|
71
|
-
case 'timestamp without time zone':
|
|
72
|
-
return 'timestamp without time zone';
|
|
73
|
-
case 'timestamp with time zone':
|
|
74
|
-
return 'timestamp with time zone';
|
|
75
|
-
case 'json':
|
|
76
|
-
return 'json';
|
|
77
|
-
case 'jsonb':
|
|
78
|
-
return 'jsonb';
|
|
79
|
-
}
|
|
73
|
+
var PostgresTypeDic = {
|
|
74
|
+
boolean: 'boolean',
|
|
75
|
+
smallint: 'smallint',
|
|
76
|
+
integer: 'integer',
|
|
77
|
+
bigint: 'bigint',
|
|
78
|
+
real: 'real',
|
|
79
|
+
'double precision': 'double precision',
|
|
80
|
+
numeric: 'numeric',
|
|
81
|
+
character: 'character',
|
|
82
|
+
'character varying': 'character varying',
|
|
83
|
+
text: 'text',
|
|
84
|
+
uuid: 'uuid',
|
|
85
|
+
date: 'date',
|
|
86
|
+
'timestamp without time zone': 'timestamp without time zone',
|
|
87
|
+
'timestamp with time zone': 'timestamp with time zone',
|
|
88
|
+
json: 'json',
|
|
89
|
+
jsonb: 'jsonb'
|
|
80
90
|
};
|
|
91
|
+
exports.PostgresTypeDic = PostgresTypeDic;
|
|
92
|
+
var toPostgresType = function (type) { return PostgresTypeDic[type]; };
|
|
81
93
|
exports.toPostgresType = toPostgresType;
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
case 'set-null':
|
|
89
|
-
return 'SET NULL';
|
|
90
|
-
case 'set-Default':
|
|
91
|
-
return 'SET DEFAULT';
|
|
92
|
-
case 'cascade':
|
|
93
|
-
return 'CASCADE';
|
|
94
|
-
}
|
|
94
|
+
var ReferenceActionDic = {
|
|
95
|
+
'no-action': 'NO ACTION',
|
|
96
|
+
restrict: 'RESTRICT',
|
|
97
|
+
'set-null': 'SET NULL',
|
|
98
|
+
'set-Default': 'SET DEFAULT',
|
|
99
|
+
cascade: 'CASCADE'
|
|
95
100
|
};
|
|
101
|
+
exports.ReferenceActionDic = ReferenceActionDic;
|
|
102
|
+
var toReferenceAction = function (action) { return ReferenceActionDic[action]; };
|
|
96
103
|
exports.toReferenceAction = toReferenceAction;
|
|
97
|
-
var
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
case '!=':
|
|
138
|
-
return 'is not equal';
|
|
139
|
-
case '>':
|
|
140
|
-
return 'is greater than';
|
|
141
|
-
case '>=':
|
|
142
|
-
return 'is greater-equal than';
|
|
143
|
-
case '<':
|
|
144
|
-
return 'is less than';
|
|
145
|
-
case '<=':
|
|
146
|
-
return 'is less-equal than';
|
|
147
|
-
case 'lk':
|
|
148
|
-
return 'does like';
|
|
149
|
-
case '@>':
|
|
150
|
-
return 'json-contain (@>)';
|
|
151
|
-
case '<@':
|
|
152
|
-
return 'json-contain (<@)';
|
|
153
|
-
case '?':
|
|
154
|
-
return 'json-exist (?)';
|
|
155
|
-
case 'j-':
|
|
156
|
-
return 'json-subtract (-)';
|
|
157
|
-
case 'in':
|
|
158
|
-
return 'is inside of';
|
|
159
|
-
case 'nin':
|
|
160
|
-
return 'is not inside of';
|
|
161
|
-
case 'lka':
|
|
162
|
-
return 'does like all';
|
|
163
|
-
case 'lks':
|
|
164
|
-
return 'does like some';
|
|
165
|
-
case '?|':
|
|
166
|
-
return 'json-does some exist (?|)';
|
|
167
|
-
case '?&':
|
|
168
|
-
return 'json-does all exist (?&)';
|
|
169
|
-
case 'j-a':
|
|
170
|
-
return 'json-subtract all (-)';
|
|
171
|
-
case 'bt':
|
|
172
|
-
return 'is between';
|
|
173
|
-
case 'qry':
|
|
174
|
-
return 'sub-query';
|
|
175
|
-
case 'exists':
|
|
176
|
-
return 'row exists in sub-query';
|
|
177
|
-
}
|
|
104
|
+
var ReservedExpressionKeyDescriptionDic = {
|
|
105
|
+
val: 'wrapped value',
|
|
106
|
+
'=n': 'is null',
|
|
107
|
+
'!=n': 'is not null',
|
|
108
|
+
'=t': 'is true',
|
|
109
|
+
'=f': 'is false',
|
|
110
|
+
not: 'not of',
|
|
111
|
+
'+': 'sum',
|
|
112
|
+
'-': 'minus',
|
|
113
|
+
'*': 'multiply',
|
|
114
|
+
'/': 'divide',
|
|
115
|
+
'||': 'concat',
|
|
116
|
+
and: 'logical and',
|
|
117
|
+
or: 'logical or',
|
|
118
|
+
'**': 'power',
|
|
119
|
+
fun: 'function',
|
|
120
|
+
swt: 'switch statement',
|
|
121
|
+
col: 'column',
|
|
122
|
+
raw: 'raw statement',
|
|
123
|
+
'=': 'is equal',
|
|
124
|
+
'!=': 'is not equal',
|
|
125
|
+
'>': 'is greater than',
|
|
126
|
+
'>=': 'is greater-equal than',
|
|
127
|
+
'<': 'is less than',
|
|
128
|
+
'<=': 'is less-equal than',
|
|
129
|
+
lk: 'does like',
|
|
130
|
+
'@>': 'json-contain (@>)',
|
|
131
|
+
'<@': 'json-contain (<@)',
|
|
132
|
+
'?': 'json-exist (?)',
|
|
133
|
+
'j-': 'json-subtract (-)',
|
|
134
|
+
in: 'is inside of',
|
|
135
|
+
nin: 'is not inside of',
|
|
136
|
+
lka: 'does like all',
|
|
137
|
+
lks: 'does like some',
|
|
138
|
+
'?|': 'json-does some exist (?|)',
|
|
139
|
+
'?&': 'json-does all exist (?&)',
|
|
140
|
+
'j-a': 'json-subtract all (-)',
|
|
141
|
+
bt: 'is between',
|
|
142
|
+
qry: 'sub-query',
|
|
143
|
+
exists: 'row exists in sub-query'
|
|
178
144
|
};
|
|
145
|
+
exports.ReservedExpressionKeyDescriptionDic = ReservedExpressionKeyDescriptionDic;
|
|
146
|
+
var toReservedExpressionKeyDescription = function (key) { return ReservedExpressionKeyDescriptionDic[key]; };
|
|
179
147
|
exports.toReservedExpressionKeyDescription = toReservedExpressionKeyDescription;
|
|
180
148
|
//# sourceMappingURL=dictionary.js.map
|
package/dist/dictionary.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.js","sourceRoot":"","sources":["../src/dictionary.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"dictionary.js","sourceRoot":"","sources":["../src/dictionary.ts"],"names":[],"mappings":";;;AASA,IAAM,sBAAsB,GAAG;IAC3B,KAAK;IACL,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;IACJ,KAAK;IACL,IAAI;IACJ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