@mrnafisia/type-query 1.0.38 → 1.0.39

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 (47) hide show
  1. package/README.md +2 -2
  2. package/dist/U.d.ts +2 -2
  3. package/dist/U.js +27 -27
  4. package/dist/context.d.ts +987 -5
  5. package/dist/context.d.ts.map +1 -1
  6. package/dist/context.js +85 -85
  7. package/dist/dictionary.d.ts +12 -12
  8. package/dist/dictionary.js +179 -179
  9. package/dist/entity.d.ts +3474 -3306
  10. package/dist/entity.d.ts.map +1 -1
  11. package/dist/entity.js +961 -960
  12. package/dist/entity.js.map +1 -1
  13. package/dist/error.d.ts +4 -4
  14. package/dist/error.js +6 -6
  15. package/dist/index.d.ts +36 -36
  16. package/dist/index.js +60 -60
  17. package/dist/model.d.ts +1005 -1005
  18. package/dist/model.js +282 -282
  19. package/dist/parser.d.ts +11 -11
  20. package/dist/parser.js +120 -120
  21. package/dist/pool.d.ts +5 -5
  22. package/dist/pool.js +121 -121
  23. package/dist/schema.d.ts +25 -25
  24. package/dist/schema.js +395 -395
  25. package/dist/testUtil.d.ts +4 -4
  26. package/dist/testUtil.js +330 -330
  27. package/dist/types/context.d.ts +55 -55
  28. package/dist/types/context.js +2 -2
  29. package/dist/types/entity.d.ts +70 -70
  30. package/dist/types/entity.js +2 -2
  31. package/dist/types/json.d.ts +8 -8
  32. package/dist/types/json.js +2 -2
  33. package/dist/types/model.d.ts +23 -23
  34. package/dist/types/model.js +2 -2
  35. package/dist/types/pool.d.ts +18 -18
  36. package/dist/types/pool.js +2 -2
  37. package/dist/types/postgres.d.ts +9 -9
  38. package/dist/types/postgres.js +2 -2
  39. package/dist/types/table.d.ts +234 -234
  40. package/dist/types/table.js +2 -2
  41. package/dist/types/testUtil.d.ts +26 -26
  42. package/dist/types/testUtil.js +2 -2
  43. package/dist/utils.d.ts +67 -67
  44. package/dist/utils.d.ts.map +1 -1
  45. package/dist/utils.js +220 -216
  46. package/dist/utils.js.map +1 -1
  47. package/package.json +39 -39
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,eAAe,CAAC;AAClC,OAAO,EAAC,OAAO,EAAE,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAEtD,QAAA,MAAM,aAAa,sCAAsC,MAAM,0BAa9D,CAAC;AAEF,QAAA,MAAM,wBAAwB,iuFACgC,MAAM,wDA8B9D,CAAC;AAEP,OAAO,EACH,aAAa,EACb,wBAAwB,EAC3B,CAAC"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,eAAe,CAAC;AAClC,OAAO,EAAC,OAAO,EAAE,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAEtD,QAAA,MAAM,aAAa,sCAAsC,MAAM,0BAa9D,CAAC;AAEF,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2pFACgC,MAAM,wDA8B9D,CAAC;AAEP,OAAO,EACH,aAAa,EACb,wBAAwB,EAC3B,CAAC"}
package/dist/context.js CHANGED
@@ -1,86 +1,86 @@
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.createContextScopeHelper = exports.createContext = void 0;
7
- var U_1 = __importDefault(require("./U"));
8
- var createContext = function (table, alias) {
9
- if (alias === void 0) { alias = ''; }
10
- var contextScopeHelper = createContextScopeHelper(table);
11
- return {
12
- col: function (column, _alias) {
13
- if (_alias === void 0) { _alias = alias; }
14
- return U_1.default.col(table, column, !!_alias, _alias);
15
- },
16
- colNull: function (column, op, _alias) {
17
- if (_alias === void 0) { _alias = alias; }
18
- return U_1.default.nullOp(U_1.default.col(table, column, !!_alias, _alias), op);
19
- },
20
- colBool: function (column, op, _alias) {
21
- if (_alias === void 0) { _alias = alias; }
22
- return U_1.default.boolOp(U_1.default.col(table, column, !!_alias, _alias), op);
23
- },
24
- colCmp: function (column, op, v, _alias) {
25
- if (_alias === void 0) { _alias = alias; }
26
- return U_1.default.cmpOp(U_1.default.col(table, column, !!_alias, _alias), op, v);
27
- },
28
- colList: function (column, op, v, _alias) {
29
- if (_alias === void 0) { _alias = alias; }
30
- return U_1.default.listOp(U_1.default.col(table, column, !!_alias, _alias), op, v);
31
- },
32
- colLike: function (column, op, v, _alias) {
33
- if (_alias === void 0) { _alias = alias; }
34
- return U_1.default.likeOp(U_1.default.col(table, column, !!_alias, _alias), op, v);
35
- },
36
- colJson: function (column, op, v, _alias) {
37
- if (_alias === void 0) { _alias = alias; }
38
- return U_1.default.jsonOp(U_1.default.col(table, column, !!_alias, _alias), op, v);
39
- },
40
- colsAnd: function (rules, _alias) {
41
- if (_alias === void 0) { _alias = alias; }
42
- return U_1.default.andAllOp(contextScopeHelper(rules, _alias));
43
- },
44
- colsOr: function (rules, _alias) {
45
- if (_alias === void 0) { _alias = alias; }
46
- return U_1.default.orAllOp(contextScopeHelper(rules, _alias));
47
- }
48
- };
49
- };
50
- exports.createContext = createContext;
51
- var createContextScopeHelper = function (table) {
52
- return function (rules, alias) { return Object.entries(rules).map(function (_a) {
53
- var key = _a[0], value = _a[1];
54
- switch (value[0]) {
55
- case '= null':
56
- case '!= null':
57
- return U_1.default.nullOp(U_1.default.col(table, key, !!alias, alias), value[0]);
58
- case '= true':
59
- case '= false':
60
- return U_1.default.boolOp(U_1.default.col(table, key, !!alias, alias), value[0]);
61
- case '=':
62
- case '!=':
63
- case '>':
64
- case '>=':
65
- case '<':
66
- case '<=':
67
- return U_1.default.cmpOp(U_1.default.col(table, key, !!alias, alias), value[0], value[1]);
68
- case 'in':
69
- case 'not in':
70
- return U_1.default.listOp(U_1.default.col(table, key, !!alias, alias), value[0], value[1]);
71
- case 'like':
72
- case 'like all':
73
- case 'like some':
74
- return U_1.default.likeOp(U_1.default.col(table, key, !!alias, alias), value[0], value[1]);
75
- case '@>':
76
- case '<@':
77
- case '?':
78
- case '?&':
79
- case '?|':
80
- return U_1.default.jsonOp(U_1.default.col(table, key, !!alias, alias), value[0], value[1]);
81
- }
82
- throw "do not except this. first element must be a reserved key. ".concat(JSON.stringify(value));
83
- }); };
84
- };
85
- exports.createContextScopeHelper = createContextScopeHelper;
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.createContextScopeHelper = exports.createContext = void 0;
7
+ var U_1 = __importDefault(require("./U"));
8
+ var createContext = function (table, alias) {
9
+ if (alias === void 0) { alias = ''; }
10
+ var contextScopeHelper = createContextScopeHelper(table);
11
+ return {
12
+ col: function (column, _alias) {
13
+ if (_alias === void 0) { _alias = alias; }
14
+ return U_1.default.col(table, column, !!_alias, _alias);
15
+ },
16
+ colNull: function (column, op, _alias) {
17
+ if (_alias === void 0) { _alias = alias; }
18
+ return U_1.default.nullOp(U_1.default.col(table, column, !!_alias, _alias), op);
19
+ },
20
+ colBool: function (column, op, _alias) {
21
+ if (_alias === void 0) { _alias = alias; }
22
+ return U_1.default.boolOp(U_1.default.col(table, column, !!_alias, _alias), op);
23
+ },
24
+ colCmp: function (column, op, v, _alias) {
25
+ if (_alias === void 0) { _alias = alias; }
26
+ return U_1.default.cmpOp(U_1.default.col(table, column, !!_alias, _alias), op, v);
27
+ },
28
+ colList: function (column, op, v, _alias) {
29
+ if (_alias === void 0) { _alias = alias; }
30
+ return U_1.default.listOp(U_1.default.col(table, column, !!_alias, _alias), op, v);
31
+ },
32
+ colLike: function (column, op, v, _alias) {
33
+ if (_alias === void 0) { _alias = alias; }
34
+ return U_1.default.likeOp(U_1.default.col(table, column, !!_alias, _alias), op, v);
35
+ },
36
+ colJson: function (column, op, v, _alias) {
37
+ if (_alias === void 0) { _alias = alias; }
38
+ return U_1.default.jsonOp(U_1.default.col(table, column, !!_alias, _alias), op, v);
39
+ },
40
+ colsAnd: function (rules, _alias) {
41
+ if (_alias === void 0) { _alias = alias; }
42
+ return U_1.default.andAllOp(contextScopeHelper(rules, _alias));
43
+ },
44
+ colsOr: function (rules, _alias) {
45
+ if (_alias === void 0) { _alias = alias; }
46
+ return U_1.default.orAllOp(contextScopeHelper(rules, _alias));
47
+ }
48
+ };
49
+ };
50
+ exports.createContext = createContext;
51
+ var createContextScopeHelper = function (table) {
52
+ return function (rules, alias) { return Object.entries(rules).map(function (_a) {
53
+ var key = _a[0], value = _a[1];
54
+ switch (value[0]) {
55
+ case '= null':
56
+ case '!= null':
57
+ return U_1.default.nullOp(U_1.default.col(table, key, !!alias, alias), value[0]);
58
+ case '= true':
59
+ case '= false':
60
+ return U_1.default.boolOp(U_1.default.col(table, key, !!alias, alias), value[0]);
61
+ case '=':
62
+ case '!=':
63
+ case '>':
64
+ case '>=':
65
+ case '<':
66
+ case '<=':
67
+ return U_1.default.cmpOp(U_1.default.col(table, key, !!alias, alias), value[0], value[1]);
68
+ case 'in':
69
+ case 'not in':
70
+ return U_1.default.listOp(U_1.default.col(table, key, !!alias, alias), value[0], value[1]);
71
+ case 'like':
72
+ case 'like all':
73
+ case 'like some':
74
+ return U_1.default.likeOp(U_1.default.col(table, key, !!alias, alias), value[0], value[1]);
75
+ case '@>':
76
+ case '<@':
77
+ case '?':
78
+ case '?&':
79
+ case '?|':
80
+ return U_1.default.jsonOp(U_1.default.col(table, key, !!alias, alias), value[0], value[1]);
81
+ }
82
+ throw "do not except this. first element must be a reserved key. ".concat(JSON.stringify(value));
83
+ }); };
84
+ };
85
+ exports.createContextScopeHelper = createContextScopeHelper;
86
86
  //# sourceMappingURL=context.js.map
@@ -1,13 +1,13 @@
1
- import type { JoinType } from './types/entity';
2
- import { ReservedExpressionKeys } from './entity';
3
- import type { OrderDirection, PostgresType } from './types/postgres';
4
- import type { ReferenceActions } from './types/table';
5
- import type { TransactionIsolationLevel } from './types/pool';
6
- declare const toTransactionMode: (isolationLevel: TransactionIsolationLevel, readOnly: boolean) => string;
7
- declare const toOrderDirection: (v: OrderDirection) => "ASC" | "DESC";
8
- declare const toJoinType: (v: JoinType) => "INNER JOIN" | "LEFT OUTER JOIN" | "RIGHT OUTER JOIN" | "FULL OUTER JOIN";
9
- declare const toPostgresType: (v: PostgresType) => "boolean" | "smallint" | "integer" | "bigint" | "real" | "double precision" | "numeric" | "character" | "character varying" | "text" | "uuid" | "date" | "timestamp without time zone" | "timestamp with time zone" | "json" | "jsonb";
10
- declare const toReferenceAction: (v: ReferenceActions) => "NO ACTION" | "RESTRICT" | "SET NULL" | "SET DEFAULT" | "CASCADE";
11
- declare const toReservedExpressionKeyDescription: (v: (typeof ReservedExpressionKeys)[Exclude<keyof typeof ReservedExpressionKeys, keyof unknown[]>]) => "wrapped value" | "is null" | "is not null" | "is true" | "is false" | "not of" | "sum" | "minus" | "multiply" | "divide" | "concat" | "logical and" | "logical or" | "power" | "function" | "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";
12
- export { toTransactionMode, toOrderDirection, toJoinType, toPostgresType, toReferenceAction, toReservedExpressionKeyDescription };
1
+ import type { JoinType } from './types/entity';
2
+ import { ReservedExpressionKeys } from './entity';
3
+ import type { OrderDirection, PostgresType } from './types/postgres';
4
+ import type { ReferenceActions } from './types/table';
5
+ import type { TransactionIsolationLevel } from './types/pool';
6
+ declare const toTransactionMode: (isolationLevel: TransactionIsolationLevel, readOnly: boolean) => string;
7
+ declare const toOrderDirection: (v: OrderDirection) => "ASC" | "DESC";
8
+ declare const toJoinType: (v: JoinType) => "INNER JOIN" | "LEFT OUTER JOIN" | "RIGHT OUTER JOIN" | "FULL OUTER JOIN";
9
+ declare const toPostgresType: (v: PostgresType) => "boolean" | "smallint" | "integer" | "bigint" | "real" | "double precision" | "numeric" | "character" | "character varying" | "text" | "uuid" | "date" | "timestamp without time zone" | "timestamp with time zone" | "json" | "jsonb";
10
+ declare const toReferenceAction: (v: ReferenceActions) => "NO ACTION" | "RESTRICT" | "SET NULL" | "SET DEFAULT" | "CASCADE";
11
+ declare const toReservedExpressionKeyDescription: (v: (typeof ReservedExpressionKeys)[Exclude<keyof typeof ReservedExpressionKeys, keyof unknown[]>]) => "wrapped value" | "is null" | "is not null" | "is true" | "is false" | "not of" | "sum" | "minus" | "multiply" | "divide" | "concat" | "logical and" | "logical or" | "power" | "function" | "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";
12
+ export { toTransactionMode, toOrderDirection, toJoinType, toPostgresType, toReferenceAction, toReservedExpressionKeyDescription };
13
13
  //# sourceMappingURL=dictionary.d.ts.map
@@ -1,180 +1,180 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toReservedExpressionKeyDescription = exports.toReferenceAction = exports.toPostgresType = exports.toJoinType = exports.toOrderDirection = exports.toTransactionMode = void 0;
4
- var toTransactionMode = function (isolationLevel, readOnly) {
5
- var result;
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');
21
- };
22
- exports.toTransactionMode = toTransactionMode;
23
- var toOrderDirection = function (v) {
24
- switch (v) {
25
- case 'asc':
26
- return 'ASC';
27
- case 'desc':
28
- return 'DESC';
29
- }
30
- };
31
- exports.toOrderDirection = toOrderDirection;
32
- var toJoinType = function (v) {
33
- switch (v) {
34
- case 'inner':
35
- return 'INNER JOIN';
36
- case 'left':
37
- return 'LEFT OUTER JOIN';
38
- case 'right':
39
- return 'RIGHT OUTER JOIN';
40
- case 'full':
41
- return 'FULL OUTER JOIN';
42
- }
43
- };
44
- exports.toJoinType = toJoinType;
45
- var toPostgresType = function (v) {
46
- switch (v) {
47
- case 'boolean':
48
- return 'boolean';
49
- case 'smallint':
50
- return 'smallint';
51
- case 'integer':
52
- return 'integer';
53
- case 'bigint':
54
- return 'bigint';
55
- case 'real':
56
- return 'real';
57
- case 'double precision':
58
- return 'double precision';
59
- case 'numeric':
60
- return 'numeric';
61
- case 'character':
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
- }
80
- };
81
- exports.toPostgresType = toPostgresType;
82
- var toReferenceAction = function (v) {
83
- switch (v) {
84
- case 'no-action':
85
- return 'NO ACTION';
86
- case 'restrict':
87
- return 'RESTRICT';
88
- case 'set-null':
89
- return 'SET NULL';
90
- case 'set-Default':
91
- return 'SET DEFAULT';
92
- case 'cascade':
93
- return 'CASCADE';
94
- }
95
- };
96
- exports.toReferenceAction = toReferenceAction;
97
- var toReservedExpressionKeyDescription = function (v) {
98
- switch (v) {
99
- case 'val':
100
- return 'wrapped value';
101
- case '=n':
102
- return 'is null';
103
- case '!=n':
104
- return 'is not null';
105
- case '=t':
106
- return 'is true';
107
- case '=f':
108
- return 'is false';
109
- case 'not':
110
- return 'not of';
111
- case '+':
112
- return 'sum';
113
- case '-':
114
- return 'minus';
115
- case '*':
116
- return 'multiply';
117
- case '/':
118
- return 'divide';
119
- case '||':
120
- return 'concat';
121
- case 'and':
122
- return 'logical and';
123
- case 'or':
124
- return 'logical or';
125
- case '**':
126
- return 'power';
127
- case 'fun':
128
- return 'function';
129
- case 'swt':
130
- return 'switch statement';
131
- case 'col':
132
- return 'column';
133
- case 'raw':
134
- return 'raw statement';
135
- case '=':
136
- return 'is equal';
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
- }
178
- };
179
- exports.toReservedExpressionKeyDescription = toReservedExpressionKeyDescription;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toReservedExpressionKeyDescription = exports.toReferenceAction = exports.toPostgresType = exports.toJoinType = exports.toOrderDirection = exports.toTransactionMode = void 0;
4
+ var toTransactionMode = function (isolationLevel, readOnly) {
5
+ var result;
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');
21
+ };
22
+ exports.toTransactionMode = toTransactionMode;
23
+ var toOrderDirection = function (v) {
24
+ switch (v) {
25
+ case 'asc':
26
+ return 'ASC';
27
+ case 'desc':
28
+ return 'DESC';
29
+ }
30
+ };
31
+ exports.toOrderDirection = toOrderDirection;
32
+ var toJoinType = function (v) {
33
+ switch (v) {
34
+ case 'inner':
35
+ return 'INNER JOIN';
36
+ case 'left':
37
+ return 'LEFT OUTER JOIN';
38
+ case 'right':
39
+ return 'RIGHT OUTER JOIN';
40
+ case 'full':
41
+ return 'FULL OUTER JOIN';
42
+ }
43
+ };
44
+ exports.toJoinType = toJoinType;
45
+ var toPostgresType = function (v) {
46
+ switch (v) {
47
+ case 'boolean':
48
+ return 'boolean';
49
+ case 'smallint':
50
+ return 'smallint';
51
+ case 'integer':
52
+ return 'integer';
53
+ case 'bigint':
54
+ return 'bigint';
55
+ case 'real':
56
+ return 'real';
57
+ case 'double precision':
58
+ return 'double precision';
59
+ case 'numeric':
60
+ return 'numeric';
61
+ case 'character':
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
+ }
80
+ };
81
+ exports.toPostgresType = toPostgresType;
82
+ var toReferenceAction = function (v) {
83
+ switch (v) {
84
+ case 'no-action':
85
+ return 'NO ACTION';
86
+ case 'restrict':
87
+ return 'RESTRICT';
88
+ case 'set-null':
89
+ return 'SET NULL';
90
+ case 'set-Default':
91
+ return 'SET DEFAULT';
92
+ case 'cascade':
93
+ return 'CASCADE';
94
+ }
95
+ };
96
+ exports.toReferenceAction = toReferenceAction;
97
+ var toReservedExpressionKeyDescription = function (v) {
98
+ switch (v) {
99
+ case 'val':
100
+ return 'wrapped value';
101
+ case '=n':
102
+ return 'is null';
103
+ case '!=n':
104
+ return 'is not null';
105
+ case '=t':
106
+ return 'is true';
107
+ case '=f':
108
+ return 'is false';
109
+ case 'not':
110
+ return 'not of';
111
+ case '+':
112
+ return 'sum';
113
+ case '-':
114
+ return 'minus';
115
+ case '*':
116
+ return 'multiply';
117
+ case '/':
118
+ return 'divide';
119
+ case '||':
120
+ return 'concat';
121
+ case 'and':
122
+ return 'logical and';
123
+ case 'or':
124
+ return 'logical or';
125
+ case '**':
126
+ return 'power';
127
+ case 'fun':
128
+ return 'function';
129
+ case 'swt':
130
+ return 'switch statement';
131
+ case 'col':
132
+ return 'column';
133
+ case 'raw':
134
+ return 'raw statement';
135
+ case '=':
136
+ return 'is equal';
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
+ }
178
+ };
179
+ exports.toReservedExpressionKeyDescription = toReservedExpressionKeyDescription;
180
180
  //# sourceMappingURL=dictionary.js.map