@riao/dbal 3.8.0 → 3.9.0

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 (269) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/LICENSE.md +20 -20
  3. package/README.md +148 -148
  4. package/builder/builder.d.ts +7 -7
  5. package/builder/builder.js +19 -19
  6. package/builder/index.d.ts +2 -2
  7. package/builder/index.js +7 -7
  8. package/builder/sql-builder.d.ts +54 -53
  9. package/builder/sql-builder.js +161 -157
  10. package/builder/sql-builder.js.map +1 -1
  11. package/builder/statement-builder.d.ts +12 -12
  12. package/builder/statement-builder.js +32 -32
  13. package/column/column-options.d.ts +156 -156
  14. package/column/column-options.js +2 -2
  15. package/column/column-type.d.ts +18 -18
  16. package/column/column-type.js +27 -27
  17. package/column/column-values.d.ts +34 -34
  18. package/column/column-values.js +2 -2
  19. package/column/create-column-template.d.ts +11 -0
  20. package/column/create-column-template.js +57 -0
  21. package/column/create-column-template.js.map +1 -0
  22. package/column/index.d.ts +4 -3
  23. package/column/index.js +20 -19
  24. package/column/index.js.map +1 -1
  25. package/column-pack/date-time/create-timestamp-column.d.ts +2 -2
  26. package/column-pack/date-time/create-timestamp-column.js +10 -10
  27. package/column-pack/date-time/index.d.ts +2 -2
  28. package/column-pack/date-time/index.js +7 -7
  29. package/column-pack/date-time/update-timestamp-column.d.ts +2 -2
  30. package/column-pack/date-time/update-timestamp-column.js +14 -14
  31. package/column-pack/index.d.ts +6 -6
  32. package/column-pack/index.js +22 -22
  33. package/column-pack/keys/big-int-key-column.d.ts +2 -2
  34. package/column-pack/keys/big-int-key-column.js +10 -10
  35. package/column-pack/keys/index.d.ts +3 -3
  36. package/column-pack/keys/index.js +9 -9
  37. package/column-pack/keys/int-key-column.d.ts +2 -2
  38. package/column-pack/keys/int-key-column.js +10 -10
  39. package/column-pack/keys/uuid-key-column.d.ts +2 -2
  40. package/column-pack/keys/uuid-key-column.js +11 -11
  41. package/column-pack/person/date-of-birth-column.d.ts +2 -2
  42. package/column-pack/person/date-of-birth-column.js +8 -8
  43. package/column-pack/person/first-name-column.d.ts +2 -2
  44. package/column-pack/person/first-name-column.js +9 -9
  45. package/column-pack/person/index.d.ts +3 -3
  46. package/column-pack/person/index.js +9 -9
  47. package/column-pack/person/last-name-column.d.ts +2 -2
  48. package/column-pack/person/last-name-column.js +9 -9
  49. package/column-pack/resource/content-column.d.ts +2 -2
  50. package/column-pack/resource/content-column.js +9 -9
  51. package/column-pack/resource/description-column.d.ts +2 -2
  52. package/column-pack/resource/description-column.js +9 -9
  53. package/column-pack/resource/index.d.ts +6 -6
  54. package/column-pack/resource/index.js +15 -15
  55. package/column-pack/resource/is-active-column.d.ts +2 -2
  56. package/column-pack/resource/is-active-column.js +9 -9
  57. package/column-pack/resource/name-column.d.ts +2 -2
  58. package/column-pack/resource/name-column.js +10 -10
  59. package/column-pack/resource/path-column.d.ts +2 -2
  60. package/column-pack/resource/path-column.js +11 -11
  61. package/column-pack/resource/title-column.d.ts +2 -2
  62. package/column-pack/resource/title-column.js +10 -10
  63. package/column-pack/system/filename-column.d.ts +2 -2
  64. package/column-pack/system/filename-column.js +9 -9
  65. package/column-pack/system/filepath-column.d.ts +2 -2
  66. package/column-pack/system/filepath-column.js +9 -9
  67. package/column-pack/system/index.d.ts +4 -4
  68. package/column-pack/system/index.js +11 -11
  69. package/column-pack/system/ip-address-column.d.ts +2 -2
  70. package/column-pack/system/ip-address-column.js +9 -9
  71. package/column-pack/system/url-column.d.ts +3 -3
  72. package/column-pack/system/url-column.js +13 -13
  73. package/column-pack/user/email-column.d.ts +2 -2
  74. package/column-pack/user/email-column.js +11 -11
  75. package/column-pack/user/index.d.ts +4 -4
  76. package/column-pack/user/index.js +11 -11
  77. package/column-pack/user/password-column.d.ts +2 -2
  78. package/column-pack/user/password-column.js +10 -10
  79. package/column-pack/user/temp-email-column.d.ts +2 -2
  80. package/column-pack/user/temp-email-column.js +5 -5
  81. package/column-pack/user/username-column.d.ts +2 -2
  82. package/column-pack/user/username-column.js +11 -11
  83. package/comparison/comparison-aliases.d.ts +10 -10
  84. package/comparison/comparison-aliases.js +40 -40
  85. package/comparison/comparison-token.d.ts +17 -17
  86. package/comparison/comparison-token.js +15 -15
  87. package/comparison/comparison.d.ts +13 -13
  88. package/comparison/comparison.js +71 -71
  89. package/comparison/index.d.ts +4 -4
  90. package/comparison/index.js +24 -24
  91. package/comparison/is-comparison-token.d.ts +2 -2
  92. package/comparison/is-comparison-token.js +8 -8
  93. package/config/configure-db.d.ts +14 -14
  94. package/config/configure-db.js +18 -18
  95. package/config/database-env.d.ts +16 -16
  96. package/config/database-env.js +14 -14
  97. package/config/index.d.ts +2 -2
  98. package/config/index.js +7 -7
  99. package/database/connection-options.d.ts +7 -7
  100. package/database/connection-options.js +2 -2
  101. package/database/database.d.ts +204 -204
  102. package/database/database.js +330 -330
  103. package/database/driver-query.d.ts +10 -10
  104. package/database/driver-query.js +2 -2
  105. package/database/driver.d.ts +12 -12
  106. package/database/driver.js +47 -47
  107. package/database/get-database-path.d.ts +6 -6
  108. package/database/get-database-path.js +12 -12
  109. package/database/index.d.ts +7 -7
  110. package/database/index.js +26 -26
  111. package/database/load-database.d.ts +9 -9
  112. package/database/load-database.js +36 -36
  113. package/database/transaction.d.ts +8 -8
  114. package/database/transaction.js +2 -2
  115. package/ddl/alter-table.d.ts +26 -26
  116. package/ddl/alter-table.js +2 -2
  117. package/ddl/create-database.d.ts +3 -3
  118. package/ddl/create-database.js +2 -2
  119. package/ddl/create-index.d.ts +5 -5
  120. package/ddl/create-index.js +2 -2
  121. package/ddl/create-table.d.ts +8 -8
  122. package/ddl/create-table.js +2 -2
  123. package/ddl/create-user.d.ts +4 -4
  124. package/ddl/create-user.js +2 -2
  125. package/ddl/ddl-builder.d.ts +96 -96
  126. package/ddl/ddl-builder.js +565 -565
  127. package/ddl/ddl-repository.d.ts +135 -135
  128. package/ddl/ddl-repository.js +228 -228
  129. package/ddl/drop-database.d.ts +4 -4
  130. package/ddl/drop-database.js +2 -2
  131. package/ddl/drop-table.d.ts +4 -4
  132. package/ddl/drop-table.js +2 -2
  133. package/ddl/drop-user.d.ts +4 -4
  134. package/ddl/drop-user.js +2 -2
  135. package/ddl/foreign-key-constraint.d.ts +19 -19
  136. package/ddl/foreign-key-constraint.js +2 -2
  137. package/ddl/grant.d.ts +12 -12
  138. package/ddl/grant.js +2 -2
  139. package/ddl/index.d.ts +13 -13
  140. package/ddl/index.js +23 -23
  141. package/ddl/truncate.d.ts +3 -3
  142. package/ddl/truncate.js +2 -2
  143. package/dml/case-expression.d.ts +16 -16
  144. package/dml/case-expression.js +11 -11
  145. package/dml/delete.d.ts +8 -8
  146. package/dml/delete.js +2 -2
  147. package/dml/from.d.ts +4 -4
  148. package/dml/from.js +2 -2
  149. package/dml/group-by.d.ts +4 -4
  150. package/dml/group-by.js +2 -2
  151. package/dml/index.d.ts +11 -11
  152. package/dml/index.js +30 -30
  153. package/dml/insert.d.ts +14 -14
  154. package/dml/insert.js +2 -2
  155. package/dml/join.d.ts +7 -7
  156. package/dml/join.js +2 -2
  157. package/dml/order-by.d.ts +2 -2
  158. package/dml/order-by.js +2 -2
  159. package/dml/query-builder.d.ts +125 -106
  160. package/dml/query-builder.js +991 -793
  161. package/dml/query-builder.js.map +1 -1
  162. package/dml/query-repository.d.ts +84 -84
  163. package/dml/query-repository.js +239 -225
  164. package/dml/query-repository.js.map +1 -1
  165. package/dml/select.d.ts +44 -29
  166. package/dml/select.js +2 -2
  167. package/dml/set-options.d.ts +5 -5
  168. package/dml/set-options.js +2 -2
  169. package/dml/subquery.d.ts +5 -5
  170. package/dml/subquery.js +10 -10
  171. package/dml/update.d.ts +11 -11
  172. package/dml/update.js +2 -2
  173. package/expression/expression-token.d.ts +11 -11
  174. package/expression/expression-token.js +12 -12
  175. package/expression/expression.d.ts +6 -6
  176. package/expression/expression.js +2 -2
  177. package/expression/identifier.d.ts +7 -7
  178. package/expression/identifier.js +15 -15
  179. package/expression/index.d.ts +7 -7
  180. package/expression/index.js +25 -25
  181. package/expression/is-expression-token.d.ts +2 -2
  182. package/expression/is-expression-token.js +7 -7
  183. package/expression/key-val-expression.d.ts +7 -7
  184. package/expression/key-val-expression.js +2 -2
  185. package/expression/literal.d.ts +3 -3
  186. package/expression/literal.js +2 -2
  187. package/expression/logical.d.ts +28 -18
  188. package/expression/logical.js +54 -30
  189. package/expression/logical.js.map +1 -1
  190. package/expression/math.d.ts +17 -17
  191. package/expression/math.js +36 -36
  192. package/expression/raw.d.ts +8 -8
  193. package/expression/raw.js +16 -16
  194. package/expression/simple-expression.d.ts +8 -8
  195. package/expression/simple-expression.js +2 -2
  196. package/functions/function-aliases.d.ts +6 -4
  197. package/functions/function-aliases.js +16 -12
  198. package/functions/function-aliases.js.map +1 -1
  199. package/functions/function-token.d.ts +33 -29
  200. package/functions/function-token.js +19 -15
  201. package/functions/function-token.js.map +1 -1
  202. package/functions/functions.d.ts +23 -19
  203. package/functions/functions.js +126 -94
  204. package/functions/functions.js.map +1 -1
  205. package/functions/index.d.ts +4 -4
  206. package/functions/index.js +22 -22
  207. package/functions/is-database-function.d.ts +8 -8
  208. package/functions/is-database-function.js +14 -14
  209. package/functions/signatures/count.d.ts +14 -11
  210. package/functions/signatures/count.js +2 -2
  211. package/index.d.ts +16 -16
  212. package/index.js +32 -32
  213. package/migration/index.d.ts +3 -3
  214. package/migration/index.js +9 -9
  215. package/migration/migration-package.d.ts +14 -14
  216. package/migration/migration-package.js +10 -10
  217. package/migration/migration-record.d.ts +10 -10
  218. package/migration/migration-record.js +2 -2
  219. package/migration/migration-runner.d.ts +33 -33
  220. package/migration/migration-runner.js +180 -180
  221. package/migration/migration.d.ts +12 -12
  222. package/migration/migration.js +27 -27
  223. package/migration/migrations/001-create-migration-table.d.ts +8 -8
  224. package/migration/migrations/001-create-migration-table.js +54 -54
  225. package/migration/migrations/002-add-migration-package-column.d.ts +9 -9
  226. package/migration/migrations/002-add-migration-package-column.js +44 -44
  227. package/package.json +1 -1
  228. package/record/index.d.ts +1 -1
  229. package/record/index.js +17 -17
  230. package/record/record.d.ts +2 -2
  231. package/record/record.js +2 -2
  232. package/repository/index.d.ts +2 -2
  233. package/repository/index.js +5 -5
  234. package/repository/repository-options.d.ts +6 -6
  235. package/repository/repository-options.js +2 -2
  236. package/repository/repository.d.ts +29 -29
  237. package/repository/repository.js +68 -68
  238. package/schema/index.d.ts +3 -3
  239. package/schema/index.js +5 -5
  240. package/schema/schema-query-repository.d.ts +54 -54
  241. package/schema/schema-query-repository.js +159 -159
  242. package/schema/schema-table.d.ts +9 -9
  243. package/schema/schema-table.js +2 -2
  244. package/schema/schema.d.ts +4 -4
  245. package/schema/schema.js +2 -2
  246. package/seed/auto-seed.d.ts +9 -9
  247. package/seed/auto-seed.js +61 -61
  248. package/seed/create-seed-table.d.ts +8 -8
  249. package/seed/create-seed-table.js +64 -64
  250. package/seed/index.d.ts +4 -4
  251. package/seed/index.js +9 -9
  252. package/seed/seed-record.d.ts +11 -11
  253. package/seed/seed-record.js +2 -2
  254. package/seed/seed-runner.d.ts +20 -20
  255. package/seed/seed-runner.js +91 -91
  256. package/seed/seed.d.ts +12 -12
  257. package/seed/seed.js +27 -27
  258. package/tokens/index.d.ts +1 -1
  259. package/tokens/index.js +5 -5
  260. package/triggers/index.d.ts +2 -2
  261. package/triggers/index.js +18 -18
  262. package/triggers/prebuilt/index.d.ts +1 -1
  263. package/triggers/prebuilt/index.js +5 -5
  264. package/triggers/prebuilt/update-timestamp-trigger.d.ts +16 -16
  265. package/triggers/prebuilt/update-timestamp-trigger.js +24 -24
  266. package/triggers/trigger-options.d.ts +22 -22
  267. package/triggers/trigger-options.js +2 -2
  268. package/triggers/trigger.d.ts +19 -19
  269. package/triggers/trigger.js +23 -23
package/dml/update.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { Expression } from '../expression';
2
- import { DatabaseRecord } from '../record';
3
- import { From } from './from';
4
- import { Join } from './join';
5
- export interface UpdateOptions<T extends DatabaseRecord = DatabaseRecord> {
6
- table?: string;
7
- from?: From;
8
- join?: Join[];
9
- set: Partial<T>;
10
- where?: Expression<T>;
11
- }
1
+ import { Expression } from '../expression';
2
+ import { DatabaseRecord } from '../record';
3
+ import { From } from './from';
4
+ import { Join } from './join';
5
+ export interface UpdateOptions<T extends DatabaseRecord = DatabaseRecord> {
6
+ table?: string;
7
+ from?: From;
8
+ join?: Join[];
9
+ set: Partial<T>;
10
+ where?: Expression<T>;
11
+ }
package/dml/update.js CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=update.js.map
@@ -1,11 +1,11 @@
1
- export declare enum ExpressionTokenKey {
2
- IDENTIFIER = "identifier",
3
- FUNCTION_CALL = "function",
4
- COMPARISON = "comparison",
5
- LOGICAL = "logical",
6
- MATH = "math",
7
- RAW = "raw"
8
- }
9
- export interface ExpressionToken {
10
- riao_expr: ExpressionTokenKey;
11
- }
1
+ export declare enum ExpressionTokenKey {
2
+ IDENTIFIER = "identifier",
3
+ FUNCTION_CALL = "function",
4
+ COMPARISON = "comparison",
5
+ LOGICAL = "logical",
6
+ MATH = "math",
7
+ RAW = "raw"
8
+ }
9
+ export interface ExpressionToken {
10
+ riao_expr: ExpressionTokenKey;
11
+ }
@@ -1,13 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExpressionTokenKey = void 0;
4
- var ExpressionTokenKey;
5
- (function (ExpressionTokenKey) {
6
- ExpressionTokenKey["IDENTIFIER"] = "identifier";
7
- ExpressionTokenKey["FUNCTION_CALL"] = "function";
8
- ExpressionTokenKey["COMPARISON"] = "comparison";
9
- ExpressionTokenKey["LOGICAL"] = "logical";
10
- ExpressionTokenKey["MATH"] = "math";
11
- ExpressionTokenKey["RAW"] = "raw";
12
- })(ExpressionTokenKey = exports.ExpressionTokenKey || (exports.ExpressionTokenKey = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExpressionTokenKey = void 0;
4
+ var ExpressionTokenKey;
5
+ (function (ExpressionTokenKey) {
6
+ ExpressionTokenKey["IDENTIFIER"] = "identifier";
7
+ ExpressionTokenKey["FUNCTION_CALL"] = "function";
8
+ ExpressionTokenKey["COMPARISON"] = "comparison";
9
+ ExpressionTokenKey["LOGICAL"] = "logical";
10
+ ExpressionTokenKey["MATH"] = "math";
11
+ ExpressionTokenKey["RAW"] = "raw";
12
+ })(ExpressionTokenKey = exports.ExpressionTokenKey || (exports.ExpressionTokenKey = {}));
13
13
  //# sourceMappingURL=expression-token.js.map
@@ -1,6 +1,6 @@
1
- import { ComparisonToken } from '../comparison';
2
- import { DatabaseRecord } from '../record';
3
- import { KeyValExpression } from './key-val-expression';
4
- import { LogicalToken, NotToken } from './logical';
5
- import { SimpleExpression } from './simple-expression';
6
- export type Expression<T extends DatabaseRecord = DatabaseRecord> = SimpleExpression | LogicalToken | NotToken | ComparisonToken | KeyValExpression<T> | Expression<T>[];
1
+ import { ComparisonToken } from '../comparison';
2
+ import { DatabaseRecord } from '../record';
3
+ import { KeyValExpression } from './key-val-expression';
4
+ import { ExistsToken, LogicalToken, NotToken } from './logical';
5
+ import { SimpleExpression } from './simple-expression';
6
+ export type Expression<T extends DatabaseRecord = DatabaseRecord> = SimpleExpression | LogicalToken | NotToken | ExistsToken | ComparisonToken | KeyValExpression<T> | Expression<T>[];
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=expression.js.map
@@ -1,7 +1,7 @@
1
- import { ExpressionToken } from './expression-token';
2
- export interface Identifier {
3
- name: string;
4
- }
5
- export type IdentifierToken = ExpressionToken & Identifier;
6
- export declare function identifier(name: string): IdentifierToken;
7
- export declare function isIdentifierToken(token: ExpressionToken): boolean;
1
+ import { ExpressionToken } from './expression-token';
2
+ export interface Identifier {
3
+ name: string;
4
+ }
5
+ export type IdentifierToken = ExpressionToken & Identifier;
6
+ export declare function identifier(name: string): IdentifierToken;
7
+ export declare function isIdentifierToken(token: ExpressionToken): boolean;
@@ -1,16 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isIdentifierToken = exports.identifier = void 0;
4
- const expression_token_1 = require("./expression-token");
5
- function identifier(name) {
6
- return {
7
- riao_expr: expression_token_1.ExpressionTokenKey.IDENTIFIER,
8
- name,
9
- };
10
- }
11
- exports.identifier = identifier;
12
- function isIdentifierToken(token) {
13
- return token.riao_expr === expression_token_1.ExpressionTokenKey.IDENTIFIER;
14
- }
15
- exports.isIdentifierToken = isIdentifierToken;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isIdentifierToken = exports.identifier = void 0;
4
+ const expression_token_1 = require("./expression-token");
5
+ function identifier(name) {
6
+ return {
7
+ riao_expr: expression_token_1.ExpressionTokenKey.IDENTIFIER,
8
+ name,
9
+ };
10
+ }
11
+ exports.identifier = identifier;
12
+ function isIdentifierToken(token) {
13
+ return token.riao_expr === expression_token_1.ExpressionTokenKey.IDENTIFIER;
14
+ }
15
+ exports.isIdentifierToken = isIdentifierToken;
16
16
  //# sourceMappingURL=identifier.js.map
@@ -1,7 +1,7 @@
1
- export { Expression } from './expression';
2
- export { isExpressionToken } from './is-expression-token';
3
- export { identifier as Identifier, isIdentifierToken } from './identifier';
4
- export * from './logical';
5
- export * from './math';
6
- export * from './raw';
7
- export { SimpleExpression } from './simple-expression';
1
+ export { Expression } from './expression';
2
+ export { isExpressionToken } from './is-expression-token';
3
+ export { identifier as Identifier, isIdentifierToken } from './identifier';
4
+ export * from './logical';
5
+ export * from './math';
6
+ export * from './raw';
7
+ export { SimpleExpression } from './simple-expression';
@@ -1,26 +1,26 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.isIdentifierToken = exports.Identifier = exports.isExpressionToken = void 0;
18
- var is_expression_token_1 = require("./is-expression-token");
19
- Object.defineProperty(exports, "isExpressionToken", { enumerable: true, get: function () { return is_expression_token_1.isExpressionToken; } });
20
- var identifier_1 = require("./identifier");
21
- Object.defineProperty(exports, "Identifier", { enumerable: true, get: function () { return identifier_1.identifier; } });
22
- Object.defineProperty(exports, "isIdentifierToken", { enumerable: true, get: function () { return identifier_1.isIdentifierToken; } });
23
- __exportStar(require("./logical"), exports);
24
- __exportStar(require("./math"), exports);
25
- __exportStar(require("./raw"), exports);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.isIdentifierToken = exports.Identifier = exports.isExpressionToken = void 0;
18
+ var is_expression_token_1 = require("./is-expression-token");
19
+ Object.defineProperty(exports, "isExpressionToken", { enumerable: true, get: function () { return is_expression_token_1.isExpressionToken; } });
20
+ var identifier_1 = require("./identifier");
21
+ Object.defineProperty(exports, "Identifier", { enumerable: true, get: function () { return identifier_1.identifier; } });
22
+ Object.defineProperty(exports, "isIdentifierToken", { enumerable: true, get: function () { return identifier_1.isIdentifierToken; } });
23
+ __exportStar(require("./logical"), exports);
24
+ __exportStar(require("./math"), exports);
25
+ __exportStar(require("./raw"), exports);
26
26
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- import { ExpressionToken } from './expression-token';
2
- export declare function isExpressionToken(val: any | ExpressionToken): boolean;
1
+ import { ExpressionToken } from './expression-token';
2
+ export declare function isExpressionToken(val: any | ExpressionToken): boolean;
@@ -1,8 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isExpressionToken = void 0;
4
- function isExpressionToken(val) {
5
- return val && typeof val === 'object' && 'riao_expr' in val;
6
- }
7
- exports.isExpressionToken = isExpressionToken;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isExpressionToken = void 0;
4
+ function isExpressionToken(val) {
5
+ return val && typeof val === 'object' && 'riao_expr' in val;
6
+ }
7
+ exports.isExpressionToken = isExpressionToken;
8
8
  //# sourceMappingURL=is-expression-token.js.map
@@ -1,7 +1,7 @@
1
- import { ComparisonToken } from '../comparison';
2
- import { DatabaseRecord } from '../record';
3
- import { NotToken } from './logical';
4
- import { SimpleExpression } from './simple-expression';
5
- export type KeyValExpression<T extends DatabaseRecord = DatabaseRecord> = {
6
- [key in keyof Partial<T>]: SimpleExpression | ComparisonToken | NotToken;
7
- };
1
+ import { ComparisonToken } from '../comparison';
2
+ import { DatabaseRecord } from '../record';
3
+ import { NotToken } from './logical';
4
+ import { SimpleExpression } from './simple-expression';
5
+ export type KeyValExpression<T extends DatabaseRecord = DatabaseRecord> = {
6
+ [key in keyof Partial<T>]: SimpleExpression | ComparisonToken | NotToken;
7
+ };
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=key-val-expression.js.map
@@ -1,3 +1,3 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- export type Literal = null | boolean | number | bigint | string | Buffer | Date;
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ export type Literal = null | boolean | number | bigint | string | Buffer | Date;
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=literal.js.map
@@ -1,18 +1,28 @@
1
- import { Expression } from './expression';
2
- import { ExpressionToken } from './expression-token';
3
- export declare enum LogicalOperator {
4
- AND = "AND",
5
- OR = "OR",
6
- NOT = "NOT"
7
- }
8
- export interface LogicalToken extends ExpressionToken {
9
- op: LogicalOperator;
10
- }
11
- export declare function isLogicalToken(token: ExpressionToken): boolean;
12
- export declare const and: LogicalToken;
13
- export declare const or: LogicalToken;
14
- export interface NotToken extends ExpressionToken {
15
- op: LogicalOperator.NOT;
16
- expr: Expression;
17
- }
18
- export declare function not(expr: Expression): NotToken;
1
+ import { Expression } from './expression';
2
+ import { ExpressionToken } from './expression-token';
3
+ import { Subquery } from '../dml/subquery';
4
+ export declare enum LogicalOperator {
5
+ AND = "AND",
6
+ OR = "OR",
7
+ NOT = "NOT",
8
+ EXISTS = "EXISTS",
9
+ NOT_EXISTS = "NOT_EXISTS"
10
+ }
11
+ export interface LogicalToken extends ExpressionToken {
12
+ op: LogicalOperator;
13
+ }
14
+ export declare function isLogicalToken(token: ExpressionToken): boolean;
15
+ export declare const and: LogicalToken;
16
+ export declare const or: LogicalToken;
17
+ export interface NotToken extends ExpressionToken {
18
+ op: LogicalOperator.NOT;
19
+ expr: Expression;
20
+ }
21
+ export declare function not(expr: Expression): NotToken;
22
+ export interface ExistsToken extends ExpressionToken {
23
+ op: LogicalOperator.EXISTS | LogicalOperator.NOT_EXISTS;
24
+ query: Subquery;
25
+ }
26
+ export declare function exists(query: Subquery): ExistsToken;
27
+ export declare function notExists(query: Subquery): ExistsToken;
28
+ export declare function isExistsToken(token: ExpressionToken): boolean;
@@ -1,31 +1,55 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.not = exports.or = exports.and = exports.isLogicalToken = exports.LogicalOperator = void 0;
4
- const expression_token_1 = require("./expression-token");
5
- var LogicalOperator;
6
- (function (LogicalOperator) {
7
- LogicalOperator["AND"] = "AND";
8
- LogicalOperator["OR"] = "OR";
9
- LogicalOperator["NOT"] = "NOT";
10
- })(LogicalOperator = exports.LogicalOperator || (exports.LogicalOperator = {}));
11
- function isLogicalToken(token) {
12
- return token.riao_expr === expression_token_1.ExpressionTokenKey.LOGICAL;
13
- }
14
- exports.isLogicalToken = isLogicalToken;
15
- exports.and = {
16
- riao_expr: expression_token_1.ExpressionTokenKey.LOGICAL,
17
- op: LogicalOperator.AND,
18
- };
19
- exports.or = {
20
- riao_expr: expression_token_1.ExpressionTokenKey.LOGICAL,
21
- op: LogicalOperator.OR,
22
- };
23
- function not(expr) {
24
- return {
25
- riao_expr: expression_token_1.ExpressionTokenKey.LOGICAL,
26
- op: LogicalOperator.NOT,
27
- expr,
28
- };
29
- }
30
- exports.not = not;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isExistsToken = exports.notExists = exports.exists = exports.not = exports.or = exports.and = exports.isLogicalToken = exports.LogicalOperator = void 0;
4
+ const expression_token_1 = require("./expression-token");
5
+ var LogicalOperator;
6
+ (function (LogicalOperator) {
7
+ LogicalOperator["AND"] = "AND";
8
+ LogicalOperator["OR"] = "OR";
9
+ LogicalOperator["NOT"] = "NOT";
10
+ LogicalOperator["EXISTS"] = "EXISTS";
11
+ LogicalOperator["NOT_EXISTS"] = "NOT_EXISTS";
12
+ })(LogicalOperator = exports.LogicalOperator || (exports.LogicalOperator = {}));
13
+ function isLogicalToken(token) {
14
+ return token.riao_expr === expression_token_1.ExpressionTokenKey.LOGICAL;
15
+ }
16
+ exports.isLogicalToken = isLogicalToken;
17
+ exports.and = {
18
+ riao_expr: expression_token_1.ExpressionTokenKey.LOGICAL,
19
+ op: LogicalOperator.AND,
20
+ };
21
+ exports.or = {
22
+ riao_expr: expression_token_1.ExpressionTokenKey.LOGICAL,
23
+ op: LogicalOperator.OR,
24
+ };
25
+ function not(expr) {
26
+ return {
27
+ riao_expr: expression_token_1.ExpressionTokenKey.LOGICAL,
28
+ op: LogicalOperator.NOT,
29
+ expr,
30
+ };
31
+ }
32
+ exports.not = not;
33
+ function exists(query) {
34
+ return {
35
+ riao_expr: expression_token_1.ExpressionTokenKey.LOGICAL,
36
+ op: LogicalOperator.EXISTS,
37
+ query,
38
+ };
39
+ }
40
+ exports.exists = exists;
41
+ function notExists(query) {
42
+ return {
43
+ riao_expr: expression_token_1.ExpressionTokenKey.LOGICAL,
44
+ op: LogicalOperator.NOT_EXISTS,
45
+ query,
46
+ };
47
+ }
48
+ exports.notExists = notExists;
49
+ function isExistsToken(token) {
50
+ return (token.riao_expr === expression_token_1.ExpressionTokenKey.LOGICAL &&
51
+ (token.op === LogicalOperator.EXISTS ||
52
+ token.op === LogicalOperator.NOT_EXISTS));
53
+ }
54
+ exports.isExistsToken = isExistsToken;
31
55
  //# sourceMappingURL=logical.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logical.js","sourceRoot":"","sources":["../../../src/expression/logical.ts"],"names":[],"mappings":";;;AACA,yDAAyE;AAEzE,IAAY,eAIX;AAJD,WAAY,eAAe;IAC1B,8BAAW,CAAA;IACX,4BAAS,CAAA;IACT,8BAAW,CAAA;AACZ,CAAC,EAJW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAI1B;AAMD,SAAgB,cAAc,CAAC,KAAsB;IACpD,OAAO,KAAK,CAAC,SAAS,KAAK,qCAAkB,CAAC,OAAO,CAAC;AACvD,CAAC;AAFD,wCAEC;AAEY,QAAA,GAAG,GAAiB;IAChC,SAAS,EAAE,qCAAkB,CAAC,OAAO;IACrC,EAAE,EAAE,eAAe,CAAC,GAAG;CACvB,CAAC;AAEW,QAAA,EAAE,GAAiB;IAC/B,SAAS,EAAE,qCAAkB,CAAC,OAAO;IACrC,EAAE,EAAE,eAAe,CAAC,EAAE;CACtB,CAAC;AAOF,SAAgB,GAAG,CAAC,IAAgB;IACnC,OAAO;QACN,SAAS,EAAE,qCAAkB,CAAC,OAAO;QACrC,EAAE,EAAE,eAAe,CAAC,GAAG;QACvB,IAAI;KACJ,CAAC;AACH,CAAC;AAND,kBAMC"}
1
+ {"version":3,"file":"logical.js","sourceRoot":"","sources":["../../../src/expression/logical.ts"],"names":[],"mappings":";;;AACA,yDAAyE;AAGzE,IAAY,eAMX;AAND,WAAY,eAAe;IAC1B,8BAAW,CAAA;IACX,4BAAS,CAAA;IACT,8BAAW,CAAA;IACX,oCAAiB,CAAA;IACjB,4CAAyB,CAAA;AAC1B,CAAC,EANW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAM1B;AAMD,SAAgB,cAAc,CAAC,KAAsB;IACpD,OAAO,KAAK,CAAC,SAAS,KAAK,qCAAkB,CAAC,OAAO,CAAC;AACvD,CAAC;AAFD,wCAEC;AAEY,QAAA,GAAG,GAAiB;IAChC,SAAS,EAAE,qCAAkB,CAAC,OAAO;IACrC,EAAE,EAAE,eAAe,CAAC,GAAG;CACvB,CAAC;AAEW,QAAA,EAAE,GAAiB;IAC/B,SAAS,EAAE,qCAAkB,CAAC,OAAO;IACrC,EAAE,EAAE,eAAe,CAAC,EAAE;CACtB,CAAC;AAOF,SAAgB,GAAG,CAAC,IAAgB;IACnC,OAAO;QACN,SAAS,EAAE,qCAAkB,CAAC,OAAO;QACrC,EAAE,EAAE,eAAe,CAAC,GAAG;QACvB,IAAI;KACJ,CAAC;AACH,CAAC;AAND,kBAMC;AAOD,SAAgB,MAAM,CAAC,KAAe;IACrC,OAAO;QACN,SAAS,EAAE,qCAAkB,CAAC,OAAO;QACrC,EAAE,EAAE,eAAe,CAAC,MAAM;QAC1B,KAAK;KACL,CAAC;AACH,CAAC;AAND,wBAMC;AAED,SAAgB,SAAS,CAAC,KAAe;IACxC,OAAO;QACN,SAAS,EAAE,qCAAkB,CAAC,OAAO;QACrC,EAAE,EAAE,eAAe,CAAC,UAAU;QAC9B,KAAK;KACL,CAAC;AACH,CAAC;AAND,8BAMC;AAED,SAAgB,aAAa,CAAC,KAAsB;IACnD,OAAO,CACN,KAAK,CAAC,SAAS,KAAK,qCAAkB,CAAC,OAAO;QAC9C,CAAE,KAAqB,CAAC,EAAE,KAAK,eAAe,CAAC,MAAM;YACnD,KAAqB,CAAC,EAAE,KAAK,eAAe,CAAC,UAAU,CAAC,CAC1D,CAAC;AACH,CAAC;AAND,sCAMC"}
@@ -1,17 +1,17 @@
1
- import { ExpressionToken } from './expression-token';
2
- export declare enum MathOperation {
3
- ADD = 0,
4
- SUB = 1,
5
- MUL = 2,
6
- DIV = 3,
7
- MOD = 4
8
- }
9
- export interface MathToken extends ExpressionToken {
10
- op: MathOperation;
11
- }
12
- export declare function isMathToken(token: ExpressionToken): boolean;
13
- export declare const plus: MathToken;
14
- export declare const minus: MathToken;
15
- export declare const times: MathToken;
16
- export declare const divide: MathToken;
17
- export declare const modulo: MathToken;
1
+ import { ExpressionToken } from './expression-token';
2
+ export declare enum MathOperation {
3
+ ADD = 0,
4
+ SUB = 1,
5
+ MUL = 2,
6
+ DIV = 3,
7
+ MOD = 4
8
+ }
9
+ export interface MathToken extends ExpressionToken {
10
+ op: MathOperation;
11
+ }
12
+ export declare function isMathToken(token: ExpressionToken): boolean;
13
+ export declare const plus: MathToken;
14
+ export declare const minus: MathToken;
15
+ export declare const times: MathToken;
16
+ export declare const divide: MathToken;
17
+ export declare const modulo: MathToken;
@@ -1,37 +1,37 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.modulo = exports.divide = exports.times = exports.minus = exports.plus = exports.isMathToken = exports.MathOperation = void 0;
4
- const expression_token_1 = require("./expression-token");
5
- var MathOperation;
6
- (function (MathOperation) {
7
- MathOperation[MathOperation["ADD"] = 0] = "ADD";
8
- MathOperation[MathOperation["SUB"] = 1] = "SUB";
9
- MathOperation[MathOperation["MUL"] = 2] = "MUL";
10
- MathOperation[MathOperation["DIV"] = 3] = "DIV";
11
- MathOperation[MathOperation["MOD"] = 4] = "MOD";
12
- })(MathOperation = exports.MathOperation || (exports.MathOperation = {}));
13
- function isMathToken(token) {
14
- return token.riao_expr === expression_token_1.ExpressionTokenKey.MATH;
15
- }
16
- exports.isMathToken = isMathToken;
17
- exports.plus = {
18
- riao_expr: expression_token_1.ExpressionTokenKey.MATH,
19
- op: MathOperation.ADD,
20
- };
21
- exports.minus = {
22
- riao_expr: expression_token_1.ExpressionTokenKey.MATH,
23
- op: MathOperation.SUB,
24
- };
25
- exports.times = {
26
- riao_expr: expression_token_1.ExpressionTokenKey.MATH,
27
- op: MathOperation.MUL,
28
- };
29
- exports.divide = {
30
- riao_expr: expression_token_1.ExpressionTokenKey.MATH,
31
- op: MathOperation.DIV,
32
- };
33
- exports.modulo = {
34
- riao_expr: expression_token_1.ExpressionTokenKey.MATH,
35
- op: MathOperation.MOD,
36
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.modulo = exports.divide = exports.times = exports.minus = exports.plus = exports.isMathToken = exports.MathOperation = void 0;
4
+ const expression_token_1 = require("./expression-token");
5
+ var MathOperation;
6
+ (function (MathOperation) {
7
+ MathOperation[MathOperation["ADD"] = 0] = "ADD";
8
+ MathOperation[MathOperation["SUB"] = 1] = "SUB";
9
+ MathOperation[MathOperation["MUL"] = 2] = "MUL";
10
+ MathOperation[MathOperation["DIV"] = 3] = "DIV";
11
+ MathOperation[MathOperation["MOD"] = 4] = "MOD";
12
+ })(MathOperation = exports.MathOperation || (exports.MathOperation = {}));
13
+ function isMathToken(token) {
14
+ return token.riao_expr === expression_token_1.ExpressionTokenKey.MATH;
15
+ }
16
+ exports.isMathToken = isMathToken;
17
+ exports.plus = {
18
+ riao_expr: expression_token_1.ExpressionTokenKey.MATH,
19
+ op: MathOperation.ADD,
20
+ };
21
+ exports.minus = {
22
+ riao_expr: expression_token_1.ExpressionTokenKey.MATH,
23
+ op: MathOperation.SUB,
24
+ };
25
+ exports.times = {
26
+ riao_expr: expression_token_1.ExpressionTokenKey.MATH,
27
+ op: MathOperation.MUL,
28
+ };
29
+ exports.divide = {
30
+ riao_expr: expression_token_1.ExpressionTokenKey.MATH,
31
+ op: MathOperation.DIV,
32
+ };
33
+ exports.modulo = {
34
+ riao_expr: expression_token_1.ExpressionTokenKey.MATH,
35
+ op: MathOperation.MOD,
36
+ };
37
37
  //# sourceMappingURL=math.js.map
@@ -1,8 +1,8 @@
1
- import { ExpressionToken, ExpressionTokenKey } from './expression-token';
2
- export interface RawExpressionToken extends ExpressionToken {
3
- riao_expr: ExpressionTokenKey.RAW;
4
- sql: string;
5
- params?: any[];
6
- }
7
- export declare function isRawExprToken(token: ExpressionToken): boolean;
8
- export declare function raw(sql: string, params?: any[]): RawExpressionToken;
1
+ import { ExpressionToken, ExpressionTokenKey } from './expression-token';
2
+ export interface RawExpressionToken extends ExpressionToken {
3
+ riao_expr: ExpressionTokenKey.RAW;
4
+ sql: string;
5
+ params?: any[];
6
+ }
7
+ export declare function isRawExprToken(token: ExpressionToken): boolean;
8
+ export declare function raw(sql: string, params?: any[]): RawExpressionToken;
package/expression/raw.js CHANGED
@@ -1,17 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.raw = exports.isRawExprToken = void 0;
4
- const expression_token_1 = require("./expression-token");
5
- function isRawExprToken(token) {
6
- return token.riao_expr === expression_token_1.ExpressionTokenKey.RAW;
7
- }
8
- exports.isRawExprToken = isRawExprToken;
9
- function raw(sql, params) {
10
- return {
11
- riao_expr: expression_token_1.ExpressionTokenKey.RAW,
12
- sql,
13
- params,
14
- };
15
- }
16
- exports.raw = raw;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.raw = exports.isRawExprToken = void 0;
4
+ const expression_token_1 = require("./expression-token");
5
+ function isRawExprToken(token) {
6
+ return token.riao_expr === expression_token_1.ExpressionTokenKey.RAW;
7
+ }
8
+ exports.isRawExprToken = isRawExprToken;
9
+ function raw(sql, params) {
10
+ return {
11
+ riao_expr: expression_token_1.ExpressionTokenKey.RAW,
12
+ sql,
13
+ params,
14
+ };
15
+ }
16
+ exports.raw = raw;
17
17
  //# sourceMappingURL=raw.js.map
@@ -1,8 +1,8 @@
1
- import { IdentifierToken } from './identifier';
2
- import { Subquery } from '../dml';
3
- import { Literal } from './literal';
4
- import { DatabaseFunctionToken } from '../functions';
5
- import { MathToken } from './math';
6
- import { RawExpressionToken } from './raw';
7
- import { CaseExpression } from '../dml/case-expression';
8
- export type SimpleExpression = Literal | RawExpressionToken | IdentifierToken | MathToken | DatabaseFunctionToken | Subquery | CaseExpression | SimpleExpression[];
1
+ import { IdentifierToken } from './identifier';
2
+ import { Subquery } from '../dml';
3
+ import { Literal } from './literal';
4
+ import { DatabaseFunctionToken } from '../functions';
5
+ import { MathToken } from './math';
6
+ import { RawExpressionToken } from './raw';
7
+ import { CaseExpression } from '../dml/case-expression';
8
+ export type SimpleExpression = Literal | RawExpressionToken | IdentifierToken | MathToken | DatabaseFunctionToken | Subquery | CaseExpression | SimpleExpression[];
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=simple-expression.js.map
@@ -1,4 +1,6 @@
1
- import { DatabaseFunctionToken } from './function-token';
2
- import { CountParams } from './signatures/count';
3
- export declare function count(params: CountParams): DatabaseFunctionToken;
4
- export declare function currentTimestamp(): DatabaseFunctionToken;
1
+ import { DatabaseFunctionToken } from './function-token';
2
+ import { CountParams } from './signatures/count';
3
+ import { Expression } from '../expression';
4
+ export declare function count(params: CountParams): DatabaseFunctionToken;
5
+ export declare function currentTimestamp(): DatabaseFunctionToken;
6
+ export declare function round(expr: Expression, decimals?: number): DatabaseFunctionToken;