@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
@@ -1,158 +1,162 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SqlBuilder = void 0;
4
- const builder_1 = require("./builder");
5
- class SqlBuilder extends builder_1.Builder {
6
- constructor() {
7
- super(...arguments);
8
- this.sql = '';
9
- this.params = [];
10
- this.usePlaceholders = true;
11
- this.operators = {
12
- closeParens: ')',
13
- openParens: '(',
14
- endStatement: ';',
15
- equals: '=',
16
- like: 'LIKE',
17
- notEqual: '!=',
18
- negate: '!',
19
- lt: '<',
20
- lte: '<=',
21
- gt: '>',
22
- gte: '>=',
23
- and: 'AND',
24
- or: 'OR',
25
- null: 'NULL',
26
- is: 'IS',
27
- in: 'IN',
28
- between: 'BETWEEN',
29
- openEnclosure: '"',
30
- closeEnclosure: '"',
31
- addition: '+',
32
- subtraction: '-',
33
- multiplication: '*',
34
- division: '/',
35
- modulo: '%',
36
- };
37
- }
38
- toDatabaseQuery() {
39
- return {
40
- sql: this.sql.trim(),
41
- params: this.params,
42
- };
43
- }
44
- // ------------------------------------------------------------------------
45
- // SQL utility functions
46
- // ------------------------------------------------------------------------
47
- append(str) {
48
- this.sql += str;
49
- return this;
50
- }
51
- appendParams(params) {
52
- this.params = this.params.concat(params);
53
- }
54
- space() {
55
- this.sql += ' ';
56
- return this;
57
- }
58
- commaSeparate(strings) {
59
- this.sql += strings.join(', ');
60
- return this;
61
- }
62
- openParens() {
63
- this.sql += this.operators.openParens;
64
- return this;
65
- }
66
- closeParens() {
67
- this.sql = this.sql.trimEnd();
68
- this.sql += this.operators.closeParens + ' ';
69
- return this;
70
- }
71
- trimEnd(s) {
72
- this.sql = this.sql.trimEnd();
73
- if (s) {
74
- s = s.trimEnd();
75
- this.sql = this.sql.substring(0, this.sql.length - s.length);
76
- }
77
- return this;
78
- }
79
- endStatement() {
80
- this.sql += this.operators.endStatement + ' ';
81
- return this;
82
- }
83
- // ------------------------------------------------------------------------
84
- // Column/Table reference enclosure
85
- // ------------------------------------------------------------------------
86
- encloseString(str) {
87
- if (!str) {
88
- return str;
89
- }
90
- return (this.operators.openEnclosure + str + this.operators.closeEnclosure);
91
- }
92
- getEnclosedName(str) {
93
- if (str.includes('.')) {
94
- return str
95
- .split('.')
96
- .map((part) => this.encloseString(part))
97
- .join('.');
98
- }
99
- else {
100
- return this.encloseString(str);
101
- }
102
- }
103
- tableName(name) {
104
- this.sql += this.getEnclosedName(name);
105
- return this;
106
- }
107
- columnName(name) {
108
- this.sql += this.getEnclosedName(name);
109
- return this;
110
- }
111
- // ------------------------------------------------------------------------
112
- // Placeholders
113
- // ------------------------------------------------------------------------
114
- enablePlaceholders() {
115
- this.usePlaceholders = true;
116
- return this;
117
- }
118
- disablePlaceholders() {
119
- this.usePlaceholders = false;
120
- return this;
121
- }
122
- appendPlaceholder(value) {
123
- this.sql += '? ';
124
- return this;
125
- }
126
- placeholder(value) {
127
- if (this.usePlaceholders) {
128
- this.appendPlaceholder(value);
129
- this.params.push(value);
130
- }
131
- else {
132
- this.appendValue(value);
133
- }
134
- return this;
135
- }
136
- appendValue(value) {
137
- if (value === null) {
138
- this.appendNull();
139
- }
140
- else if (typeof value === 'string') {
141
- this.appendStringValue(value);
142
- }
143
- else {
144
- this.append(value);
145
- }
146
- return this;
147
- }
148
- appendNull() {
149
- this.append(this.operators.null);
150
- return this;
151
- }
152
- appendStringValue(value) {
153
- this.append(`'${value}'`);
154
- return this;
155
- }
156
- }
157
- exports.SqlBuilder = SqlBuilder;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SqlBuilder = void 0;
4
+ const builder_1 = require("./builder");
5
+ class SqlBuilder extends builder_1.Builder {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.sql = '';
9
+ this.params = [];
10
+ this.usePlaceholders = true;
11
+ this.operators = {
12
+ closeParens: ')',
13
+ openParens: '(',
14
+ endStatement: ';',
15
+ equals: '=',
16
+ like: 'LIKE',
17
+ notEqual: '!=',
18
+ negate: '!',
19
+ lt: '<',
20
+ lte: '<=',
21
+ gt: '>',
22
+ gte: '>=',
23
+ and: 'AND',
24
+ or: 'OR',
25
+ null: 'NULL',
26
+ is: 'IS',
27
+ in: 'IN',
28
+ between: 'BETWEEN',
29
+ openEnclosure: '"',
30
+ closeEnclosure: '"',
31
+ addition: '+',
32
+ subtraction: '-',
33
+ multiplication: '*',
34
+ division: '/',
35
+ modulo: '%',
36
+ };
37
+ }
38
+ toDatabaseQuery() {
39
+ return {
40
+ sql: this.sql.trim(),
41
+ params: this.params,
42
+ };
43
+ }
44
+ // ------------------------------------------------------------------------
45
+ // SQL utility functions
46
+ // ------------------------------------------------------------------------
47
+ prepend(str) {
48
+ this.sql = str + this.sql;
49
+ return this;
50
+ }
51
+ append(str) {
52
+ this.sql += str;
53
+ return this;
54
+ }
55
+ appendParams(params) {
56
+ this.params = this.params.concat(params);
57
+ }
58
+ space() {
59
+ this.sql += ' ';
60
+ return this;
61
+ }
62
+ commaSeparate(strings) {
63
+ this.sql += strings.join(', ');
64
+ return this;
65
+ }
66
+ openParens() {
67
+ this.sql += this.operators.openParens;
68
+ return this;
69
+ }
70
+ closeParens() {
71
+ this.sql = this.sql.trimEnd();
72
+ this.sql += this.operators.closeParens + ' ';
73
+ return this;
74
+ }
75
+ trimEnd(s) {
76
+ this.sql = this.sql.trimEnd();
77
+ if (s) {
78
+ s = s.trimEnd();
79
+ this.sql = this.sql.substring(0, this.sql.length - s.length);
80
+ }
81
+ return this;
82
+ }
83
+ endStatement() {
84
+ this.sql += this.operators.endStatement + ' ';
85
+ return this;
86
+ }
87
+ // ------------------------------------------------------------------------
88
+ // Column/Table reference enclosure
89
+ // ------------------------------------------------------------------------
90
+ encloseString(str) {
91
+ if (!str) {
92
+ return str;
93
+ }
94
+ return (this.operators.openEnclosure + str + this.operators.closeEnclosure);
95
+ }
96
+ getEnclosedName(str) {
97
+ if (str.includes('.')) {
98
+ return str
99
+ .split('.')
100
+ .map((part) => this.encloseString(part))
101
+ .join('.');
102
+ }
103
+ else {
104
+ return this.encloseString(str);
105
+ }
106
+ }
107
+ tableName(name) {
108
+ this.sql += this.getEnclosedName(name);
109
+ return this;
110
+ }
111
+ columnName(name) {
112
+ this.sql += this.getEnclosedName(name);
113
+ return this;
114
+ }
115
+ // ------------------------------------------------------------------------
116
+ // Placeholders
117
+ // ------------------------------------------------------------------------
118
+ enablePlaceholders() {
119
+ this.usePlaceholders = true;
120
+ return this;
121
+ }
122
+ disablePlaceholders() {
123
+ this.usePlaceholders = false;
124
+ return this;
125
+ }
126
+ appendPlaceholder(value) {
127
+ this.sql += '? ';
128
+ return this;
129
+ }
130
+ placeholder(value) {
131
+ if (this.usePlaceholders) {
132
+ this.appendPlaceholder(value);
133
+ this.params.push(value);
134
+ }
135
+ else {
136
+ this.appendValue(value);
137
+ }
138
+ return this;
139
+ }
140
+ appendValue(value) {
141
+ if (value === null) {
142
+ this.appendNull();
143
+ }
144
+ else if (typeof value === 'string') {
145
+ this.appendStringValue(value);
146
+ }
147
+ else {
148
+ this.append(value);
149
+ }
150
+ return this;
151
+ }
152
+ appendNull() {
153
+ this.append(this.operators.null);
154
+ return this;
155
+ }
156
+ appendStringValue(value) {
157
+ this.append(`'${value}'`);
158
+ return this;
159
+ }
160
+ }
161
+ exports.SqlBuilder = SqlBuilder;
158
162
  //# sourceMappingURL=sql-builder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sql-builder.js","sourceRoot":"","sources":["../../../src/builder/sql-builder.ts"],"names":[],"mappings":";;;AACA,uCAAoC;AAEpC,MAAa,UAAW,SAAQ,iBAAO;IAAvC;;QACW,QAAG,GAAG,EAAE,CAAC;QACT,WAAM,GAAU,EAAE,CAAC;QACnB,oBAAe,GAAG,IAAI,CAAC;QAE1B,cAAS,GAAG;YAClB,WAAW,EAAE,GAAG;YAChB,UAAU,EAAE,GAAG;YACf,YAAY,EAAE,GAAG;YACjB,MAAM,EAAE,GAAG;YACX,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,GAAG;YACX,EAAE,EAAE,GAAG;YACP,GAAG,EAAE,IAAI;YACT,EAAE,EAAE,GAAG;YACP,GAAG,EAAE,IAAI;YACT,GAAG,EAAE,KAAK;YACV,EAAE,EAAE,I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AAC,CAAC;YAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACxB;aACI;YACJ,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;SACxB;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,WAAW,CAAC,KAAU;QAC5B,IAAI,KAAK,KAAK,IAAI,EAAE;YACnB,IAAI,CAAC,UAAU,EAAE,CAAC;SAClB;aACI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YACnC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;SAC9B;aACI;YACJ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SACnB;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,UAAU;QAChB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAEjC,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,iBAAiB,CAAC,KAAa;QACrC,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC;QAE1B,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAtMD,gCAsMC"}
@@ -1,12 +1,12 @@
1
- import { Builder } from './builder';
2
- import { SqlBuilder } from './sql-builder';
3
- import { DatabaseQueryOptions } from '../database';
4
- export declare abstract class StatementBuilder extends Builder {
5
- protected sql: SqlBuilder;
6
- constructor();
7
- protected getSqlType(): typeof SqlBuilder;
8
- toDatabaseQuery(): DatabaseQueryOptions;
9
- appendBuilder(builder: Builder): void;
10
- disablePlaceholders(): this;
11
- enablePlaceholders(): this;
12
- }
1
+ import { Builder } from './builder';
2
+ import { SqlBuilder } from './sql-builder';
3
+ import { DatabaseQueryOptions } from '../database';
4
+ export declare abstract class StatementBuilder extends Builder {
5
+ protected sql: SqlBuilder;
6
+ constructor();
7
+ protected getSqlType(): typeof SqlBuilder;
8
+ toDatabaseQuery(): DatabaseQueryOptions;
9
+ appendBuilder(builder: Builder): void;
10
+ disablePlaceholders(): this;
11
+ enablePlaceholders(): this;
12
+ }
@@ -1,33 +1,33 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StatementBuilder = void 0;
4
- const builder_1 = require("./builder");
5
- const sql_builder_1 = require("./sql-builder");
6
- class StatementBuilder extends builder_1.Builder {
7
- constructor() {
8
- super();
9
- this.sql = new (this.getSqlType())();
10
- }
11
- getSqlType() {
12
- return sql_builder_1.SqlBuilder;
13
- }
14
- toDatabaseQuery() {
15
- return this.sql.toDatabaseQuery();
16
- }
17
- appendBuilder(builder) {
18
- var _a;
19
- const q = builder.toDatabaseQuery();
20
- this.sql.append(q.sql);
21
- this.sql.appendParams((_a = q.params) !== null && _a !== void 0 ? _a : []);
22
- }
23
- disablePlaceholders() {
24
- this.sql.disablePlaceholders();
25
- return this;
26
- }
27
- enablePlaceholders() {
28
- this.sql.enablePlaceholders();
29
- return this;
30
- }
31
- }
32
- exports.StatementBuilder = StatementBuilder;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StatementBuilder = void 0;
4
+ const builder_1 = require("./builder");
5
+ const sql_builder_1 = require("./sql-builder");
6
+ class StatementBuilder extends builder_1.Builder {
7
+ constructor() {
8
+ super();
9
+ this.sql = new (this.getSqlType())();
10
+ }
11
+ getSqlType() {
12
+ return sql_builder_1.SqlBuilder;
13
+ }
14
+ toDatabaseQuery() {
15
+ return this.sql.toDatabaseQuery();
16
+ }
17
+ appendBuilder(builder) {
18
+ var _a;
19
+ const q = builder.toDatabaseQuery();
20
+ this.sql.append(q.sql);
21
+ this.sql.appendParams((_a = q.params) !== null && _a !== void 0 ? _a : []);
22
+ }
23
+ disablePlaceholders() {
24
+ this.sql.disablePlaceholders();
25
+ return this;
26
+ }
27
+ enablePlaceholders() {
28
+ this.sql.enablePlaceholders();
29
+ return this;
30
+ }
31
+ }
32
+ exports.StatementBuilder = StatementBuilder;
33
33
  //# sourceMappingURL=statement-builder.js.map