pure-orm 4.0.2 → 4.1.4
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/.benchmarks/bench-core-baseline.json +303 -0
- package/.eslintrc.json +20 -10
- package/README.md +0 -7
- package/coverage/clover.xml +1493 -1232
- package/coverage/coverage-final.json +103 -103
- package/coverage/lcov-report/dist/src/core.js.html +590 -383
- package/coverage/lcov-report/dist/src/driver-integrations/index.html +20 -20
- package/coverage/lcov-report/dist/src/driver-integrations/pgp.js.html +52 -52
- package/coverage/lcov-report/dist/src/index.html +28 -28
- package/coverage/lcov-report/dist/src/index.js.html +2 -2
- package/coverage/lcov-report/dist/src/orm.js.html +392 -209
- package/coverage/lcov-report/dist/test-utils/blog/entities.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/blog/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/blog/models/article.js.html +15 -15
- package/coverage/lcov-report/dist/test-utils/blog/models/article_tag.js.html +2 -2
- package/coverage/lcov-report/dist/test-utils/blog/models/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/blog/models/person.js.html +13 -13
- package/coverage/lcov-report/dist/test-utils/blog/models/tag.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/five/entities.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/five/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/five/models/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/five/models/line-item.js.html +4 -4
- package/coverage/lcov-report/dist/test-utils/five/models/order.js.html +3 -3
- package/coverage/lcov-report/dist/test-utils/five/models/parcel-event.js.html +6 -6
- package/coverage/lcov-report/dist/test-utils/five/models/parcel-line-item.js.html +7 -7
- package/coverage/lcov-report/dist/test-utils/five/models/parcel.js.html +2 -2
- package/coverage/lcov-report/dist/test-utils/fourteen/entities.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/fourteen/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/fourteen/models/customer.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/fourteen/models/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/fourteen/models/person.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/nine/entities.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/nine/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/nine/models/feature-switch.js.html +6 -6
- package/coverage/lcov-report/dist/test-utils/nine/models/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/entities.js.html +9 -9
- package/coverage/lcov-report/dist/test-utils/order/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/models/index.html +14 -14
- package/coverage/lcov-report/dist/test-utils/order/models/line-item.js.html +11 -11
- package/coverage/lcov-report/dist/test-utils/order/models/order.js.html +41 -41
- package/coverage/lcov-report/dist/test-utils/order/models/product-variant.js.html +18 -18
- package/coverage/lcov-report/dist/test-utils/order/models/product.js.html +17 -17
- package/coverage/lcov-report/dist/test-utils/order/models/utm-source.js.html +12 -12
- package/coverage/lcov-report/dist/test-utils/order-more/entities.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/actual-product-variant.js.html +3 -3
- package/coverage/lcov-report/dist/test-utils/order-more/models/color.js.html +6 -6
- package/coverage/lcov-report/dist/test-utils/order-more/models/customer.js.html +3 -3
- package/coverage/lcov-report/dist/test-utils/order-more/models/gender.js.html +4 -4
- package/coverage/lcov-report/dist/test-utils/order-more/models/index.html +23 -23
- package/coverage/lcov-report/dist/test-utils/order-more/models/inventory-level.js.html +11 -11
- package/coverage/lcov-report/dist/test-utils/order-more/models/line-item.js.html +15 -15
- package/coverage/lcov-report/dist/test-utils/order-more/models/order.js.html +39 -39
- package/coverage/lcov-report/dist/test-utils/order-more/models/parcel-event.js.html +6 -6
- package/coverage/lcov-report/dist/test-utils/order-more/models/parcel-line-item.js.html +7 -7
- package/coverage/lcov-report/dist/test-utils/order-more/models/parcel.js.html +2 -2
- package/coverage/lcov-report/dist/test-utils/order-more/models/physical-address.js.html +12 -12
- package/coverage/lcov-report/dist/test-utils/order-more/models/product-variant-image.js.html +7 -7
- package/coverage/lcov-report/dist/test-utils/order-more/models/product-variant.js.html +22 -22
- package/coverage/lcov-report/dist/test-utils/order-more/models/product.js.html +11 -11
- package/coverage/lcov-report/dist/test-utils/order-more/models/refund.js.html +11 -11
- package/coverage/lcov-report/dist/test-utils/order-more/models/shipment-actual-product-variant.js.html +9 -9
- package/coverage/lcov-report/dist/test-utils/order-more/models/shipment.js.html +4 -4
- package/coverage/lcov-report/dist/test-utils/order-more/models/size.js.html +4 -4
- package/coverage/lcov-report/dist/test-utils/order-more/models/utm-medium.js.html +15 -15
- package/coverage/lcov-report/dist/test-utils/order-more/models/utm-source.js.html +17 -17
- package/coverage/lcov-report/dist/test-utils/six/entities.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/six/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/six/models/customer.js.html +3 -3
- package/coverage/lcov-report/dist/test-utils/six/models/index.html +21 -21
- package/coverage/lcov-report/dist/test-utils/six/models/line-item.js.html +10 -10
- package/coverage/lcov-report/dist/test-utils/six/models/order.js.html +13 -13
- package/coverage/lcov-report/dist/test-utils/six/models/parcel-line-item.js.html +2 -2
- package/coverage/lcov-report/dist/test-utils/six/models/parcel.js.html +2 -2
- package/coverage/lcov-report/dist/test-utils/thirteen/entities.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/models/audience.js.html +2 -2
- package/coverage/lcov-report/dist/test-utils/thirteen/models/brand.js.html +2 -2
- package/coverage/lcov-report/dist/test-utils/thirteen/models/category.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/models/index.html +14 -14
- package/coverage/lcov-report/dist/test-utils/thirteen/models/member.js.html +2 -2
- package/coverage/lcov-report/dist/test-utils/thirteen/models/passion.js.html +2 -2
- package/coverage/lcov-report/dist/test-utils/thirteen/models/product.js.html +10 -10
- package/coverage/lcov-report/dist/test-utils/thirteen/models/recommendation-audience.js.html +2 -2
- package/coverage/lcov-report/dist/test-utils/thirteen/models/recommendation.js.html +2 -2
- package/coverage/lcov-report/dist/test-utils/three/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/three/results.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/twelve/entities.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/twelve/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/twelve/models/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/twelve/models/member.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/twelve/models/prompt.js.html +2 -2
- package/coverage/lcov-report/dist/test-utils/two/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/two/results.js.html +1 -1
- package/coverage/lcov-report/index.html +103 -103
- package/coverage/lcov-report/src/core.ts.html +841 -415
- package/coverage/lcov-report/src/driver-integrations/index.html +20 -20
- package/coverage/lcov-report/src/driver-integrations/pgp.ts.html +63 -63
- package/coverage/lcov-report/src/index.html +28 -28
- package/coverage/lcov-report/src/index.ts.html +1 -1
- package/coverage/lcov-report/src/orm.ts.html +388 -298
- package/coverage/lcov-report/test-utils/blog/entities.ts.html +1 -1
- package/coverage/lcov-report/test-utils/blog/index.html +1 -1
- package/coverage/lcov-report/test-utils/blog/models/article.ts.html +15 -15
- package/coverage/lcov-report/test-utils/blog/models/article_tag.ts.html +2 -2
- package/coverage/lcov-report/test-utils/blog/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/blog/models/person.ts.html +13 -13
- package/coverage/lcov-report/test-utils/blog/models/tag.ts.html +1 -1
- package/coverage/lcov-report/test-utils/five/entities.ts.html +1 -1
- package/coverage/lcov-report/test-utils/five/index.html +1 -1
- package/coverage/lcov-report/test-utils/five/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/five/models/line-item.ts.html +4 -4
- package/coverage/lcov-report/test-utils/five/models/order.ts.html +3 -3
- package/coverage/lcov-report/test-utils/five/models/parcel-event.ts.html +6 -6
- package/coverage/lcov-report/test-utils/five/models/parcel-line-item.ts.html +7 -7
- package/coverage/lcov-report/test-utils/five/models/parcel.ts.html +2 -2
- package/coverage/lcov-report/test-utils/fourteen/entities.ts.html +1 -1
- package/coverage/lcov-report/test-utils/fourteen/index.html +1 -1
- package/coverage/lcov-report/test-utils/fourteen/models/customer.ts.html +1 -1
- package/coverage/lcov-report/test-utils/fourteen/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/fourteen/models/person.ts.html +1 -1
- package/coverage/lcov-report/test-utils/nine/entities.ts.html +1 -1
- package/coverage/lcov-report/test-utils/nine/index.html +1 -1
- package/coverage/lcov-report/test-utils/nine/models/feature-switch.ts.html +8 -8
- package/coverage/lcov-report/test-utils/nine/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/order/entities.ts.html +2 -2
- package/coverage/lcov-report/test-utils/order/index.html +1 -1
- package/coverage/lcov-report/test-utils/order/models/index.html +14 -14
- package/coverage/lcov-report/test-utils/order/models/line-item.ts.html +5 -5
- package/coverage/lcov-report/test-utils/order/models/order.ts.html +36 -36
- package/coverage/lcov-report/test-utils/order/models/product-variant.ts.html +13 -13
- package/coverage/lcov-report/test-utils/order/models/product.ts.html +13 -13
- package/coverage/lcov-report/test-utils/order/models/utm-source.ts.html +8 -8
- package/coverage/lcov-report/test-utils/order-more/entities.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/index.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/actual-product-variant.ts.html +3 -3
- package/coverage/lcov-report/test-utils/order-more/models/color.ts.html +6 -6
- package/coverage/lcov-report/test-utils/order-more/models/customer.ts.html +3 -3
- package/coverage/lcov-report/test-utils/order-more/models/gender.ts.html +4 -4
- package/coverage/lcov-report/test-utils/order-more/models/index.html +23 -23
- package/coverage/lcov-report/test-utils/order-more/models/inventory-level.ts.html +11 -11
- package/coverage/lcov-report/test-utils/order-more/models/line-item.ts.html +15 -15
- package/coverage/lcov-report/test-utils/order-more/models/order.ts.html +45 -45
- package/coverage/lcov-report/test-utils/order-more/models/parcel-event.ts.html +6 -6
- package/coverage/lcov-report/test-utils/order-more/models/parcel-line-item.ts.html +7 -7
- package/coverage/lcov-report/test-utils/order-more/models/parcel.ts.html +2 -2
- package/coverage/lcov-report/test-utils/order-more/models/physical-address.ts.html +12 -12
- package/coverage/lcov-report/test-utils/order-more/models/product-variant-image.ts.html +7 -7
- package/coverage/lcov-report/test-utils/order-more/models/product-variant.ts.html +22 -22
- package/coverage/lcov-report/test-utils/order-more/models/product.ts.html +11 -11
- package/coverage/lcov-report/test-utils/order-more/models/refund.ts.html +11 -11
- package/coverage/lcov-report/test-utils/order-more/models/shipment-actual-product-variant.ts.html +9 -9
- package/coverage/lcov-report/test-utils/order-more/models/shipment.ts.html +4 -4
- package/coverage/lcov-report/test-utils/order-more/models/size.ts.html +4 -4
- package/coverage/lcov-report/test-utils/order-more/models/utm-medium.ts.html +15 -15
- package/coverage/lcov-report/test-utils/order-more/models/utm-source.ts.html +17 -17
- package/coverage/lcov-report/test-utils/six/entities.ts.html +1 -1
- package/coverage/lcov-report/test-utils/six/index.html +1 -1
- package/coverage/lcov-report/test-utils/six/models/customer.ts.html +3 -3
- package/coverage/lcov-report/test-utils/six/models/index.html +21 -21
- package/coverage/lcov-report/test-utils/six/models/line-item.ts.html +10 -10
- package/coverage/lcov-report/test-utils/six/models/order.ts.html +13 -13
- package/coverage/lcov-report/test-utils/six/models/parcel-line-item.ts.html +2 -2
- package/coverage/lcov-report/test-utils/six/models/parcel.ts.html +2 -2
- package/coverage/lcov-report/test-utils/thirteen/entities.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/index.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/audience.ts.html +2 -2
- package/coverage/lcov-report/test-utils/thirteen/models/brand.ts.html +2 -2
- package/coverage/lcov-report/test-utils/thirteen/models/category.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/index.html +14 -14
- package/coverage/lcov-report/test-utils/thirteen/models/member.ts.html +2 -2
- package/coverage/lcov-report/test-utils/thirteen/models/passion.ts.html +2 -2
- package/coverage/lcov-report/test-utils/thirteen/models/product.ts.html +10 -10
- package/coverage/lcov-report/test-utils/thirteen/models/recommendation-audience.ts.html +2 -2
- package/coverage/lcov-report/test-utils/thirteen/models/recommendation.ts.html +2 -2
- package/coverage/lcov-report/test-utils/three/index.html +1 -1
- package/coverage/lcov-report/test-utils/three/results.js.html +1 -1
- package/coverage/lcov-report/test-utils/twelve/entities.ts.html +1 -1
- package/coverage/lcov-report/test-utils/twelve/index.html +1 -1
- package/coverage/lcov-report/test-utils/twelve/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/twelve/models/member.ts.html +1 -1
- package/coverage/lcov-report/test-utils/twelve/models/prompt.ts.html +2 -2
- package/coverage/lcov-report/test-utils/two/index.html +1 -1
- package/coverage/lcov-report/test-utils/two/results.js.html +1 -1
- package/coverage/lcov.info +2136 -1991
- package/dist/example/data-access/person.d.ts +1 -1
- package/dist/src/core.d.ts +13 -7
- package/dist/src/core.js +258 -189
- package/dist/src/core.spec.js +413 -0
- package/dist/src/driver-integrations/index.d.ts +5 -5
- package/dist/src/driver-integrations/pgp.spec.d.ts +1 -0
- package/dist/src/driver-integrations/pgp.spec.js +376 -0
- package/dist/src/orm.d.ts +9 -9
- package/dist/src/orm.js +137 -76
- package/dist/src/orm.spec.js +535 -85
- package/dist/test-utils/nine/models/feature-switch.d.ts +2 -2
- package/dist/test-utils/nine/models/feature-switch.ts +2 -2
- package/example/data-access/person.ts +1 -1
- package/package.json +9 -6
- package/scripts/bench-core.js +636 -0
- package/scripts/check-bench-scenarios.js +47 -0
- package/src/core.spec.ts +485 -2
- package/src/core.ts +369 -227
- package/src/driver-integrations/index.ts +5 -5
- package/src/driver-integrations/pgp.spec.ts +444 -0
- package/src/driver-integrations/pgp.ts +5 -5
- package/src/orm.spec.ts +592 -88
- package/src/orm.ts +173 -143
- package/test-utils/nine/models/feature-switch.ts +2 -2
|
@@ -20,31 +20,31 @@
|
|
|
20
20
|
</h1>
|
|
21
21
|
<div class='clearfix'>
|
|
22
22
|
<div class='fl pad1y space-right2'>
|
|
23
|
-
<span class="strong">
|
|
23
|
+
<span class="strong">100% </span>
|
|
24
24
|
<span class="quiet">Statements</span>
|
|
25
|
-
<span class='fraction'>
|
|
25
|
+
<span class='fraction'>159/159</span>
|
|
26
26
|
</div>
|
|
27
27
|
<div class='fl pad1y space-right2'>
|
|
28
|
-
<span class="strong">
|
|
28
|
+
<span class="strong">88.89% </span>
|
|
29
29
|
<span class="quiet">Branches</span>
|
|
30
|
-
<span class='fraction'>
|
|
30
|
+
<span class='fraction'>24/27</span>
|
|
31
31
|
</div>
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">100% </span>
|
|
34
34
|
<span class="quiet">Functions</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>17/17</span>
|
|
36
36
|
</div>
|
|
37
37
|
<div class='fl pad1y space-right2'>
|
|
38
|
-
<span class="strong">
|
|
38
|
+
<span class="strong">100% </span>
|
|
39
39
|
<span class="quiet">Lines</span>
|
|
40
|
-
<span class='fraction'>
|
|
40
|
+
<span class='fraction'>153/153</span>
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
43
43
|
<p class="quiet">
|
|
44
44
|
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
45
45
|
</p>
|
|
46
46
|
</div>
|
|
47
|
-
<div class='status-line
|
|
47
|
+
<div class='status-line high'></div>
|
|
48
48
|
<pre><table class="coverage">
|
|
49
49
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
50
50
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -240,180 +240,302 @@
|
|
|
240
240
|
<a name='L192'></a><a href='#L192'>192</a>
|
|
241
241
|
<a name='L193'></a><a href='#L193'>193</a>
|
|
242
242
|
<a name='L194'></a><a href='#L194'>194</a>
|
|
243
|
-
<a name='L195'></a><a href='#L195'>195</a
|
|
243
|
+
<a name='L195'></a><a href='#L195'>195</a>
|
|
244
|
+
<a name='L196'></a><a href='#L196'>196</a>
|
|
245
|
+
<a name='L197'></a><a href='#L197'>197</a>
|
|
246
|
+
<a name='L198'></a><a href='#L198'>198</a>
|
|
247
|
+
<a name='L199'></a><a href='#L199'>199</a>
|
|
248
|
+
<a name='L200'></a><a href='#L200'>200</a>
|
|
249
|
+
<a name='L201'></a><a href='#L201'>201</a>
|
|
250
|
+
<a name='L202'></a><a href='#L202'>202</a>
|
|
251
|
+
<a name='L203'></a><a href='#L203'>203</a>
|
|
252
|
+
<a name='L204'></a><a href='#L204'>204</a>
|
|
253
|
+
<a name='L205'></a><a href='#L205'>205</a>
|
|
254
|
+
<a name='L206'></a><a href='#L206'>206</a>
|
|
255
|
+
<a name='L207'></a><a href='#L207'>207</a>
|
|
256
|
+
<a name='L208'></a><a href='#L208'>208</a>
|
|
257
|
+
<a name='L209'></a><a href='#L209'>209</a>
|
|
258
|
+
<a name='L210'></a><a href='#L210'>210</a>
|
|
259
|
+
<a name='L211'></a><a href='#L211'>211</a>
|
|
260
|
+
<a name='L212'></a><a href='#L212'>212</a>
|
|
261
|
+
<a name='L213'></a><a href='#L213'>213</a>
|
|
262
|
+
<a name='L214'></a><a href='#L214'>214</a>
|
|
263
|
+
<a name='L215'></a><a href='#L215'>215</a>
|
|
264
|
+
<a name='L216'></a><a href='#L216'>216</a>
|
|
265
|
+
<a name='L217'></a><a href='#L217'>217</a>
|
|
266
|
+
<a name='L218'></a><a href='#L218'>218</a>
|
|
267
|
+
<a name='L219'></a><a href='#L219'>219</a>
|
|
268
|
+
<a name='L220'></a><a href='#L220'>220</a>
|
|
269
|
+
<a name='L221'></a><a href='#L221'>221</a>
|
|
270
|
+
<a name='L222'></a><a href='#L222'>222</a>
|
|
271
|
+
<a name='L223'></a><a href='#L223'>223</a>
|
|
272
|
+
<a name='L224'></a><a href='#L224'>224</a>
|
|
273
|
+
<a name='L225'></a><a href='#L225'>225</a>
|
|
274
|
+
<a name='L226'></a><a href='#L226'>226</a>
|
|
275
|
+
<a name='L227'></a><a href='#L227'>227</a>
|
|
276
|
+
<a name='L228'></a><a href='#L228'>228</a>
|
|
277
|
+
<a name='L229'></a><a href='#L229'>229</a>
|
|
278
|
+
<a name='L230'></a><a href='#L230'>230</a>
|
|
279
|
+
<a name='L231'></a><a href='#L231'>231</a>
|
|
280
|
+
<a name='L232'></a><a href='#L232'>232</a>
|
|
281
|
+
<a name='L233'></a><a href='#L233'>233</a>
|
|
282
|
+
<a name='L234'></a><a href='#L234'>234</a>
|
|
283
|
+
<a name='L235'></a><a href='#L235'>235</a>
|
|
284
|
+
<a name='L236'></a><a href='#L236'>236</a>
|
|
285
|
+
<a name='L237'></a><a href='#L237'>237</a>
|
|
286
|
+
<a name='L238'></a><a href='#L238'>238</a>
|
|
287
|
+
<a name='L239'></a><a href='#L239'>239</a>
|
|
288
|
+
<a name='L240'></a><a href='#L240'>240</a>
|
|
289
|
+
<a name='L241'></a><a href='#L241'>241</a>
|
|
290
|
+
<a name='L242'></a><a href='#L242'>242</a>
|
|
291
|
+
<a name='L243'></a><a href='#L243'>243</a>
|
|
292
|
+
<a name='L244'></a><a href='#L244'>244</a>
|
|
293
|
+
<a name='L245'></a><a href='#L245'>245</a>
|
|
294
|
+
<a name='L246'></a><a href='#L246'>246</a>
|
|
295
|
+
<a name='L247'></a><a href='#L247'>247</a>
|
|
296
|
+
<a name='L248'></a><a href='#L248'>248</a>
|
|
297
|
+
<a name='L249'></a><a href='#L249'>249</a>
|
|
298
|
+
<a name='L250'></a><a href='#L250'>250</a>
|
|
299
|
+
<a name='L251'></a><a href='#L251'>251</a>
|
|
300
|
+
<a name='L252'></a><a href='#L252'>252</a>
|
|
301
|
+
<a name='L253'></a><a href='#L253'>253</a>
|
|
302
|
+
<a name='L254'></a><a href='#L254'>254</a>
|
|
303
|
+
<a name='L255'></a><a href='#L255'>255</a>
|
|
304
|
+
<a name='L256'></a><a href='#L256'>256</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
244
305
|
<span class="cline-any cline-yes">1x</span>
|
|
245
306
|
<span class="cline-any cline-yes">1x</span>
|
|
246
307
|
<span class="cline-any cline-yes">1x</span>
|
|
247
308
|
<span class="cline-any cline-yes">1x</span>
|
|
248
309
|
<span class="cline-any cline-yes">1x</span>
|
|
249
|
-
<span class="cline-any cline-yes">
|
|
310
|
+
<span class="cline-any cline-yes">41x</span>
|
|
250
311
|
<span class="cline-any cline-neutral"> </span>
|
|
251
|
-
<span class="cline-any cline-yes">
|
|
252
|
-
<span class="cline-any cline-yes">
|
|
312
|
+
<span class="cline-any cline-yes">41x</span>
|
|
313
|
+
<span class="cline-any cline-yes">40x</span>
|
|
253
314
|
<span class="cline-any cline-neutral"> </span>
|
|
254
315
|
<span class="cline-any cline-neutral"> </span>
|
|
255
|
-
<span class="cline-any cline-
|
|
316
|
+
<span class="cline-any cline-yes">1x</span>
|
|
256
317
|
<span class="cline-any cline-neutral"> </span>
|
|
318
|
+
<span class="cline-any cline-yes">40x</span>
|
|
319
|
+
<span class="cline-any cline-yes">40x</span>
|
|
320
|
+
<span class="cline-any cline-yes">23x</span>
|
|
321
|
+
<span class="cline-any cline-yes">23x</span>
|
|
322
|
+
<span class="cline-any cline-yes">23x</span>
|
|
323
|
+
<span class="cline-any cline-yes">23x</span>
|
|
324
|
+
<span class="cline-any cline-yes">23x</span>
|
|
325
|
+
<span class="cline-any cline-yes">23x</span>
|
|
326
|
+
<span class="cline-any cline-yes">23x</span>
|
|
327
|
+
<span class="cline-any cline-yes">552x</span>
|
|
328
|
+
<span class="cline-any cline-yes">552x</span>
|
|
329
|
+
<span class="cline-any cline-yes">552x</span>
|
|
330
|
+
<span class="cline-any cline-yes">552x</span>
|
|
331
|
+
<span class="cline-any cline-yes">552x</span>
|
|
257
332
|
<span class="cline-any cline-neutral"> </span>
|
|
333
|
+
<span class="cline-any cline-yes">23x</span>
|
|
258
334
|
<span class="cline-any cline-neutral"> </span>
|
|
259
335
|
<span class="cline-any cline-neutral"> </span>
|
|
260
|
-
<span class="cline-any cline-yes">6x</span>
|
|
261
|
-
<span class="cline-any cline-yes">1x</span>
|
|
262
336
|
<span class="cline-any cline-neutral"> </span>
|
|
263
|
-
<span class="cline-any cline-yes">24x</span>
|
|
264
|
-
<span class="cline-any cline-yes">4x</span>
|
|
265
337
|
<span class="cline-any cline-neutral"> </span>
|
|
266
|
-
<span class="cline-any cline-yes">1x</span>
|
|
267
338
|
<span class="cline-any cline-neutral"> </span>
|
|
268
|
-
<span class="cline-any cline-yes">
|
|
269
|
-
<span class="cline-any cline-yes">24x</span>
|
|
270
|
-
<span class="cline-any cline-yes">4x</span>
|
|
271
|
-
<span class="cline-any cline-yes">1x</span>
|
|
339
|
+
<span class="cline-any cline-yes">23x</span>
|
|
272
340
|
<span class="cline-any cline-neutral"> </span>
|
|
273
|
-
<span class="cline-any cline-yes">
|
|
274
|
-
<span class="cline-any cline-yes">1x</span>
|
|
341
|
+
<span class="cline-any cline-yes">23x</span>
|
|
275
342
|
<span class="cline-any cline-neutral"> </span>
|
|
276
|
-
<span class="cline-any cline-yes">
|
|
277
|
-
<span class="cline-any cline-yes">
|
|
278
|
-
<span class="cline-any cline-yes">
|
|
279
|
-
<span class="cline-any cline-yes">
|
|
280
|
-
<span class="cline-any cline-yes">
|
|
343
|
+
<span class="cline-any cline-yes">40x</span>
|
|
344
|
+
<span class="cline-any cline-yes">5x</span>
|
|
345
|
+
<span class="cline-any cline-yes">5x</span>
|
|
346
|
+
<span class="cline-any cline-yes">5x</span>
|
|
347
|
+
<span class="cline-any cline-yes">5x</span>
|
|
348
|
+
<span class="cline-any cline-yes">5x</span>
|
|
349
|
+
<span class="cline-any cline-yes">5x</span>
|
|
350
|
+
<span class="cline-any cline-yes">5x</span>
|
|
351
|
+
<span class="cline-any cline-yes">5x</span>
|
|
352
|
+
<span class="cline-any cline-yes">120x</span>
|
|
353
|
+
<span class="cline-any cline-yes">120x</span>
|
|
354
|
+
<span class="cline-any cline-yes">12x</span>
|
|
355
|
+
<span class="cline-any cline-yes">7x</span>
|
|
356
|
+
<span class="cline-any cline-neutral"> </span>
|
|
357
|
+
<span class="cline-any cline-yes">12x</span>
|
|
358
|
+
<span class="cline-any cline-yes">12x</span>
|
|
359
|
+
<span class="cline-any cline-yes">12x</span>
|
|
360
|
+
<span class="cline-any cline-yes">12x</span>
|
|
281
361
|
<span class="cline-any cline-neutral"> </span>
|
|
282
|
-
<span class="cline-any cline-yes">24x</span>
|
|
283
|
-
<span class="cline-any cline-yes">24x</span>
|
|
284
|
-
<span class="cline-any cline-yes">1x</span>
|
|
285
|
-
<span class="cline-any cline-yes">1x</span>
|
|
286
362
|
<span class="cline-any cline-neutral"> </span>
|
|
363
|
+
<span class="cline-any cline-yes">5x</span>
|
|
364
|
+
<span class="cline-any cline-neutral"> </span>
|
|
365
|
+
<span class="cline-any cline-yes">40x</span>
|
|
287
366
|
<span class="cline-any cline-yes">6x</span>
|
|
288
|
-
<span class="cline-any cline-yes">
|
|
367
|
+
<span class="cline-any cline-yes">6x</span>
|
|
368
|
+
<span class="cline-any cline-yes">6x</span>
|
|
369
|
+
<span class="cline-any cline-yes">6x</span>
|
|
370
|
+
<span class="cline-any cline-yes">6x</span>
|
|
371
|
+
<span class="cline-any cline-yes">6x</span>
|
|
372
|
+
<span class="cline-any cline-yes">6x</span>
|
|
373
|
+
<span class="cline-any cline-yes">144x</span>
|
|
374
|
+
<span class="cline-any cline-yes">144x</span>
|
|
375
|
+
<span class="cline-any cline-yes">13x</span>
|
|
376
|
+
<span class="cline-any cline-yes">7x</span>
|
|
289
377
|
<span class="cline-any cline-neutral"> </span>
|
|
290
|
-
<span class="cline-any cline-yes">
|
|
378
|
+
<span class="cline-any cline-yes">13x</span>
|
|
379
|
+
<span class="cline-any cline-yes">13x</span>
|
|
380
|
+
<span class="cline-any cline-yes">13x</span>
|
|
291
381
|
<span class="cline-any cline-neutral"> </span>
|
|
292
382
|
<span class="cline-any cline-neutral"> </span>
|
|
293
|
-
<span class="cline-any cline-yes">
|
|
294
|
-
<span class="cline-any cline-yes">
|
|
383
|
+
<span class="cline-any cline-yes">6x</span>
|
|
384
|
+
<span class="cline-any cline-yes">6x</span>
|
|
385
|
+
<span class="cline-any cline-yes">6x</span>
|
|
295
386
|
<span class="cline-any cline-neutral"> </span>
|
|
296
|
-
<span class="cline-any cline-yes">
|
|
387
|
+
<span class="cline-any cline-yes">40x</span>
|
|
388
|
+
<span class="cline-any cline-yes">10x</span>
|
|
389
|
+
<span class="cline-any cline-yes">10x</span>
|
|
390
|
+
<span class="cline-any cline-yes">10x</span>
|
|
391
|
+
<span class="cline-any cline-yes">10x</span>
|
|
392
|
+
<span class="cline-any cline-yes">10x</span>
|
|
393
|
+
<span class="cline-any cline-yes">10x</span>
|
|
394
|
+
<span class="cline-any cline-yes">10x</span>
|
|
395
|
+
<span class="cline-any cline-yes">240x</span>
|
|
396
|
+
<span class="cline-any cline-yes">240x</span>
|
|
397
|
+
<span class="cline-any cline-yes">14x</span>
|
|
398
|
+
<span class="cline-any cline-yes">4x</span>
|
|
297
399
|
<span class="cline-any cline-neutral"> </span>
|
|
298
|
-
<span class="cline-any cline-yes">
|
|
400
|
+
<span class="cline-any cline-yes">14x</span>
|
|
401
|
+
<span class="cline-any cline-yes">14x</span>
|
|
402
|
+
<span class="cline-any cline-yes">14x</span>
|
|
299
403
|
<span class="cline-any cline-neutral"> </span>
|
|
300
404
|
<span class="cline-any cline-neutral"> </span>
|
|
301
|
-
<span class="cline-any cline-yes">
|
|
302
|
-
<span class="cline-any cline-yes">1x</span>
|
|
405
|
+
<span class="cline-any cline-yes">10x</span>
|
|
303
406
|
<span class="cline-any cline-neutral"> </span>
|
|
304
407
|
<span class="cline-any cline-neutral"> </span>
|
|
305
408
|
<span class="cline-any cline-neutral"> </span>
|
|
306
|
-
<span class="cline-any cline-yes">
|
|
307
|
-
<span class="cline-any cline-yes">
|
|
409
|
+
<span class="cline-any cline-yes">40x</span>
|
|
410
|
+
<span class="cline-any cline-yes">2x</span>
|
|
411
|
+
<span class="cline-any cline-yes">2x</span>
|
|
412
|
+
<span class="cline-any cline-yes">2x</span>
|
|
413
|
+
<span class="cline-any cline-yes">2x</span>
|
|
414
|
+
<span class="cline-any cline-yes">2x</span>
|
|
415
|
+
<span class="cline-any cline-yes">2x</span>
|
|
416
|
+
<span class="cline-any cline-yes">2x</span>
|
|
417
|
+
<span class="cline-any cline-yes">48x</span>
|
|
418
|
+
<span class="cline-any cline-yes">48x</span>
|
|
419
|
+
<span class="cline-any cline-yes">5x</span>
|
|
420
|
+
<span class="cline-any cline-yes">3x</span>
|
|
308
421
|
<span class="cline-any cline-neutral"> </span>
|
|
309
|
-
<span class="cline-any cline-yes">
|
|
422
|
+
<span class="cline-any cline-yes">5x</span>
|
|
423
|
+
<span class="cline-any cline-yes">5x</span>
|
|
424
|
+
<span class="cline-any cline-yes">5x</span>
|
|
310
425
|
<span class="cline-any cline-neutral"> </span>
|
|
311
426
|
<span class="cline-any cline-neutral"> </span>
|
|
312
|
-
<span class="cline-any cline-yes">
|
|
313
|
-
<span class="cline-any cline-yes">4x</span>
|
|
427
|
+
<span class="cline-any cline-yes">2x</span>
|
|
314
428
|
<span class="cline-any cline-neutral"> </span>
|
|
315
|
-
<span class="cline-any cline-yes">
|
|
429
|
+
<span class="cline-any cline-yes">40x</span>
|
|
430
|
+
<span class="cline-any cline-yes">3x</span>
|
|
431
|
+
<span class="cline-any cline-yes">3x</span>
|
|
432
|
+
<span class="cline-any cline-yes">3x</span>
|
|
433
|
+
<span class="cline-any cline-yes">3x</span>
|
|
434
|
+
<span class="cline-any cline-yes">6x</span>
|
|
435
|
+
<span class="cline-any cline-yes">6x</span>
|
|
436
|
+
<span class="cline-any cline-yes">6x</span>
|
|
316
437
|
<span class="cline-any cline-neutral"> </span>
|
|
317
|
-
<span class="cline-any cline-yes">24x</span>
|
|
318
438
|
<span class="cline-any cline-neutral"> </span>
|
|
439
|
+
<span class="cline-any cline-yes">3x</span>
|
|
319
440
|
<span class="cline-any cline-neutral"> </span>
|
|
320
|
-
<span class="cline-any cline-yes">
|
|
321
|
-
<span class="cline-any cline-yes">
|
|
322
|
-
<span class="cline-any cline-yes">
|
|
441
|
+
<span class="cline-any cline-yes">40x</span>
|
|
442
|
+
<span class="cline-any cline-yes">5x</span>
|
|
443
|
+
<span class="cline-any cline-yes">5x</span>
|
|
444
|
+
<span class="cline-any cline-yes">5x</span>
|
|
323
445
|
<span class="cline-any cline-neutral"> </span>
|
|
324
|
-
<span class="cline-any cline-yes">6x</span>
|
|
325
|
-
<span class="cline-any cline-no"> </span>
|
|
326
|
-
<span class="cline-any cline-no"> </span>
|
|
327
|
-
<span class="cline-any cline-no"> </span>
|
|
328
|
-
<span class="cline-any cline-no"> </span>
|
|
329
|
-
<span class="cline-any cline-no"> </span>
|
|
330
446
|
<span class="cline-any cline-neutral"> </span>
|
|
331
|
-
<span class="cline-any cline-no"> </span>
|
|
332
447
|
<span class="cline-any cline-neutral"> </span>
|
|
448
|
+
<span class="cline-any cline-yes">40x</span>
|
|
449
|
+
<span class="cline-any cline-yes">6x</span>
|
|
333
450
|
<span class="cline-any cline-yes">6x</span>
|
|
334
|
-
<span class="cline-any cline-yes">4x</span>
|
|
335
|
-
<span class="cline-any cline-neutral"> </span>
|
|
336
451
|
<span class="cline-any cline-yes">6x</span>
|
|
337
|
-
<span class="cline-any cline-yes">3x</span>
|
|
338
452
|
<span class="cline-any cline-neutral"> </span>
|
|
339
453
|
<span class="cline-any cline-neutral"> </span>
|
|
340
454
|
<span class="cline-any cline-neutral"> </span>
|
|
341
455
|
<span class="cline-any cline-neutral"> </span>
|
|
342
456
|
<span class="cline-any cline-neutral"> </span>
|
|
343
|
-
<span class="cline-any cline-yes">
|
|
344
|
-
<span class="cline-any cline-
|
|
345
|
-
<span class="cline-any cline-
|
|
457
|
+
<span class="cline-any cline-yes">40x</span>
|
|
458
|
+
<span class="cline-any cline-yes">2x</span>
|
|
459
|
+
<span class="cline-any cline-yes">2x</span>
|
|
460
|
+
<span class="cline-any cline-yes">2x</span>
|
|
346
461
|
<span class="cline-any cline-neutral"> </span>
|
|
347
462
|
<span class="cline-any cline-neutral"> </span>
|
|
348
463
|
<span class="cline-any cline-neutral"> </span>
|
|
349
464
|
<span class="cline-any cline-neutral"> </span>
|
|
350
|
-
<span class="cline-any cline-
|
|
465
|
+
<span class="cline-any cline-yes">2x</span>
|
|
351
466
|
<span class="cline-any cline-neutral"> </span>
|
|
352
467
|
<span class="cline-any cline-neutral"> </span>
|
|
353
|
-
<span class="cline-any cline-yes">
|
|
354
|
-
<span class="cline-any cline-
|
|
355
|
-
<span class="cline-any cline-
|
|
468
|
+
<span class="cline-any cline-yes">40x</span>
|
|
469
|
+
<span class="cline-any cline-yes">2x</span>
|
|
470
|
+
<span class="cline-any cline-yes">2x</span>
|
|
471
|
+
<span class="cline-any cline-yes">2x</span>
|
|
356
472
|
<span class="cline-any cline-neutral"> </span>
|
|
357
473
|
<span class="cline-any cline-neutral"> </span>
|
|
358
474
|
<span class="cline-any cline-neutral"> </span>
|
|
359
475
|
<span class="cline-any cline-neutral"> </span>
|
|
360
476
|
<span class="cline-any cline-neutral"> </span>
|
|
361
|
-
<span class="cline-any cline-
|
|
477
|
+
<span class="cline-any cline-yes">2x</span>
|
|
362
478
|
<span class="cline-any cline-neutral"> </span>
|
|
363
479
|
<span class="cline-any cline-neutral"> </span>
|
|
364
|
-
<span class="cline-any cline-yes">
|
|
365
|
-
<span class="cline-any cline-
|
|
366
|
-
<span class="cline-any cline-
|
|
480
|
+
<span class="cline-any cline-yes">40x</span>
|
|
481
|
+
<span class="cline-any cline-yes">1x</span>
|
|
482
|
+
<span class="cline-any cline-yes">1x</span>
|
|
483
|
+
<span class="cline-any cline-yes">1x</span>
|
|
367
484
|
<span class="cline-any cline-neutral"> </span>
|
|
368
485
|
<span class="cline-any cline-neutral"> </span>
|
|
369
486
|
<span class="cline-any cline-neutral"> </span>
|
|
370
|
-
<span class="cline-any cline-
|
|
487
|
+
<span class="cline-any cline-yes">1x</span>
|
|
371
488
|
<span class="cline-any cline-neutral"> </span>
|
|
372
|
-
<span class="cline-any cline-yes">
|
|
373
|
-
<span class="cline-any cline-
|
|
374
|
-
<span class="cline-any cline-
|
|
489
|
+
<span class="cline-any cline-yes">40x</span>
|
|
490
|
+
<span class="cline-any cline-yes">1x</span>
|
|
491
|
+
<span class="cline-any cline-yes">1x</span>
|
|
492
|
+
<span class="cline-any cline-yes">1x</span>
|
|
375
493
|
<span class="cline-any cline-neutral"> </span>
|
|
376
494
|
<span class="cline-any cline-neutral"> </span>
|
|
377
495
|
<span class="cline-any cline-neutral"> </span>
|
|
378
|
-
<span class="cline-any cline-
|
|
496
|
+
<span class="cline-any cline-yes">1x</span>
|
|
379
497
|
<span class="cline-any cline-neutral"> </span>
|
|
380
|
-
<span class="cline-any cline-yes">
|
|
381
|
-
<span class="cline-any cline-
|
|
382
|
-
<span class="cline-any cline-
|
|
498
|
+
<span class="cline-any cline-yes">40x</span>
|
|
499
|
+
<span class="cline-any cline-yes">1x</span>
|
|
500
|
+
<span class="cline-any cline-yes">1x</span>
|
|
501
|
+
<span class="cline-any cline-yes">1x</span>
|
|
383
502
|
<span class="cline-any cline-neutral"> </span>
|
|
384
503
|
<span class="cline-any cline-neutral"> </span>
|
|
385
504
|
<span class="cline-any cline-neutral"> </span>
|
|
386
505
|
<span class="cline-any cline-neutral"> </span>
|
|
387
|
-
<span class="cline-any cline-
|
|
506
|
+
<span class="cline-any cline-yes">1x</span>
|
|
388
507
|
<span class="cline-any cline-neutral"> </span>
|
|
389
|
-
<span class="cline-any cline-yes">
|
|
390
|
-
<span class="cline-any cline-
|
|
391
|
-
<span class="cline-any cline-
|
|
508
|
+
<span class="cline-any cline-yes">40x</span>
|
|
509
|
+
<span class="cline-any cline-yes">2x</span>
|
|
510
|
+
<span class="cline-any cline-yes">2x</span>
|
|
511
|
+
<span class="cline-any cline-yes">2x</span>
|
|
392
512
|
<span class="cline-any cline-neutral"> </span>
|
|
393
513
|
<span class="cline-any cline-neutral"> </span>
|
|
394
514
|
<span class="cline-any cline-neutral"> </span>
|
|
395
515
|
<span class="cline-any cline-neutral"> </span>
|
|
396
|
-
<span class="cline-any cline-
|
|
516
|
+
<span class="cline-any cline-yes">2x</span>
|
|
397
517
|
<span class="cline-any cline-neutral"> </span>
|
|
398
|
-
<span class="cline-any cline-yes">
|
|
399
|
-
<span class="cline-any cline-
|
|
400
|
-
<span class="cline-any cline-
|
|
518
|
+
<span class="cline-any cline-yes">40x</span>
|
|
519
|
+
<span class="cline-any cline-yes">2x</span>
|
|
520
|
+
<span class="cline-any cline-yes">2x</span>
|
|
521
|
+
<span class="cline-any cline-yes">2x</span>
|
|
401
522
|
<span class="cline-any cline-neutral"> </span>
|
|
402
523
|
<span class="cline-any cline-neutral"> </span>
|
|
403
524
|
<span class="cline-any cline-neutral"> </span>
|
|
404
525
|
<span class="cline-any cline-neutral"> </span>
|
|
405
|
-
<span class="cline-any cline-
|
|
526
|
+
<span class="cline-any cline-yes">2x</span>
|
|
406
527
|
<span class="cline-any cline-neutral"> </span>
|
|
407
|
-
<span class="cline-any cline-yes">
|
|
408
|
-
<span class="cline-any cline-
|
|
409
|
-
<span class="cline-any cline-
|
|
528
|
+
<span class="cline-any cline-yes">40x</span>
|
|
529
|
+
<span class="cline-any cline-yes">2x</span>
|
|
530
|
+
<span class="cline-any cline-yes">2x</span>
|
|
531
|
+
<span class="cline-any cline-yes">2x</span>
|
|
410
532
|
<span class="cline-any cline-neutral"> </span>
|
|
411
533
|
<span class="cline-any cline-neutral"> </span>
|
|
412
534
|
<span class="cline-any cline-neutral"> </span>
|
|
413
535
|
<span class="cline-any cline-neutral"> </span>
|
|
414
|
-
<span class="cline-any cline-
|
|
536
|
+
<span class="cline-any cline-yes">2x</span>
|
|
415
537
|
<span class="cline-any cline-neutral"> </span>
|
|
416
|
-
<span class="cline-any cline-yes">
|
|
538
|
+
<span class="cline-any cline-yes">40x</span>
|
|
417
539
|
<span class="cline-any cline-neutral"> </span>
|
|
418
540
|
<span class="cline-any cline-neutral"> </span>
|
|
419
541
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -442,170 +564,231 @@ const pgp_1 = require("./driver-integrations/pgp");
|
|
|
442
564
|
const create = ({ entities: externalEntities, db, logError }) => {
|
|
443
565
|
const core = (0, core_1.createCore)({ entities: externalEntities });
|
|
444
566
|
let orm;
|
|
445
|
-
|
|
567
|
+
if (db.$config.pgp) {
|
|
446
568
|
orm = (0, pgp_1.createForPGP)({ core, db, logError });
|
|
447
569
|
}
|
|
448
570
|
else {
|
|
449
|
-
|
|
571
|
+
throw new Error(`You're database driver is not yet supported. You can make a PR to add it, or use the \`createCore\` export which doesn't try to abstract over the database driver, and instead you pass the results of the database driver queries to it.`);
|
|
450
572
|
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
573
|
+
const helperPlanByEntity = new Map();
|
|
574
|
+
const getHelperPlan = (entity) => {
|
|
575
|
+
let plan = helperPlanByEntity.get(entity);
|
|
576
|
+
<span class="missing-if-branch" title="else path not taken" >E</span>if (!plan) {
|
|
577
|
+
const quotedColumns = new Array(entity.columnNames.length);
|
|
578
|
+
const updateClausePrefixes = new Array(entity.columnNames.length);
|
|
579
|
+
const wherePositionalPrefixes = new Array(entity.columnNames.length);
|
|
580
|
+
const whereNamedPrefixes = new Array(entity.columnNames.length);
|
|
581
|
+
for (let i = 0; i < entity.columnNames.length; i++) {
|
|
582
|
+
const column = entity.columnNames[i];
|
|
583
|
+
quotedColumns[i] = `"${column}"`;
|
|
584
|
+
updateClausePrefixes[i] = `"${column}" = $`;
|
|
585
|
+
wherePositionalPrefixes[i] = `"${entity.tableName}"."${column}" = $`;
|
|
586
|
+
whereNamedPrefixes[i] = `"${entity.tableName}"."${column}" = $(`;
|
|
587
|
+
}
|
|
588
|
+
plan = {
|
|
589
|
+
quotedColumns,
|
|
590
|
+
updateClausePrefixes,
|
|
591
|
+
wherePositionalPrefixes,
|
|
592
|
+
whereNamedPrefixes
|
|
593
|
+
};
|
|
594
|
+
helperPlanByEntity.set(entity, plan);
|
|
595
|
+
}
|
|
596
|
+
return plan;
|
|
597
|
+
};
|
|
454
598
|
const getSqlInsertParts = (model) => {
|
|
455
|
-
const
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
599
|
+
const entity = orm.getEntityByModel(model);
|
|
600
|
+
const { columnNames, propertyNames } = entity;
|
|
601
|
+
const helperPlan = getHelperPlan(entity);
|
|
602
|
+
let columns = '';
|
|
603
|
+
const values = [];
|
|
604
|
+
const valuesVar = [];
|
|
605
|
+
let paramIndex = 1;
|
|
606
|
+
for (let i = 0; i < columnNames.length; i++) {
|
|
607
|
+
const val = model[propertyNames[i]];
|
|
608
|
+
if (val !== void 0) {
|
|
609
|
+
if (columns) {
|
|
610
|
+
columns += ', ';
|
|
611
|
+
}
|
|
612
|
+
columns += helperPlan.quotedColumns[i];
|
|
613
|
+
values.push(val);
|
|
614
|
+
valuesVar.push(`$${paramIndex}`);
|
|
615
|
+
paramIndex++;
|
|
616
|
+
}
|
|
617
|
+
}
|
|
465
618
|
return { columns, values, valuesVar };
|
|
466
619
|
};
|
|
467
620
|
const getSqlUpdateParts = (model, on = 'id') => {
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
const
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
621
|
+
const entity = orm.getEntityByModel(model);
|
|
622
|
+
const { columnNames, propertyNames } = entity;
|
|
623
|
+
const helperPlan = getHelperPlan(entity);
|
|
624
|
+
let clause = '';
|
|
625
|
+
const values = [];
|
|
626
|
+
let paramIndex = 1;
|
|
627
|
+
for (let i = 0; i < columnNames.length; i++) {
|
|
628
|
+
const val = model[propertyNames[i]];
|
|
629
|
+
if (val !== void 0) {
|
|
630
|
+
if (clause) {
|
|
631
|
+
clause += ', ';
|
|
632
|
+
}
|
|
633
|
+
clause += helperPlan.updateClausePrefixes[i] + paramIndex;
|
|
634
|
+
values.push(val);
|
|
635
|
+
paramIndex++;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
const idVar = `$${paramIndex}`;
|
|
639
|
+
values.push(model[on]);
|
|
479
640
|
return { clause, idVar, values };
|
|
480
641
|
};
|
|
481
642
|
const getMatchingParts = (model) => {
|
|
482
|
-
const
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
643
|
+
const entity = orm.getEntityByModel(model);
|
|
644
|
+
const { propertyNames, columnNames } = entity;
|
|
645
|
+
const helperPlan = getHelperPlan(entity);
|
|
646
|
+
const values = [];
|
|
647
|
+
let paramIndex = 1;
|
|
648
|
+
let whereClause = '';
|
|
649
|
+
for (let i = 0; i < propertyNames.length; i++) {
|
|
650
|
+
const val = model[propertyNames[i]];
|
|
651
|
+
if (val != null) {
|
|
652
|
+
if (whereClause) {
|
|
653
|
+
whereClause += ' AND ';
|
|
654
|
+
}
|
|
655
|
+
whereClause += helperPlan.wherePositionalPrefixes[i] + paramIndex;
|
|
656
|
+
values.push(val);
|
|
657
|
+
paramIndex++;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
496
660
|
return { whereClause, values };
|
|
497
661
|
};
|
|
498
662
|
// This one returns an object, which allows it to be more versatile.
|
|
499
663
|
// To-do: make this one even better and use it instead of the one above.
|
|
500
664
|
const getMatchingPartsObject = (model) => {
|
|
501
|
-
const
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
665
|
+
const entity = orm.getEntityByModel(model);
|
|
666
|
+
const { propertyNames, columnNames } = entity;
|
|
667
|
+
const helperPlan = getHelperPlan(entity);
|
|
668
|
+
const values = {};
|
|
669
|
+
let paramIndex = 1;
|
|
670
|
+
let whereClause = '';
|
|
671
|
+
for (let i = 0; i < propertyNames.length; i++) {
|
|
672
|
+
const val = model[propertyNames[i]];
|
|
673
|
+
if (val != null) {
|
|
674
|
+
if (whereClause) {
|
|
675
|
+
whereClause += ' AND ';
|
|
676
|
+
}
|
|
677
|
+
whereClause += helperPlan.whereNamedPrefixes[i] + paramIndex + ')';
|
|
678
|
+
values[paramIndex] = val;
|
|
679
|
+
paramIndex++;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
516
682
|
return { whereClause, values };
|
|
517
683
|
};
|
|
518
|
-
const getNewWith =
|
|
519
|
-
const Constructor =
|
|
520
|
-
const
|
|
521
|
-
const modelData =
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
684
|
+
const getNewWith = (model, sqlColumns, values) => {
|
|
685
|
+
const Constructor = model.constructor;
|
|
686
|
+
const entity = orm.getEntityByModel(model);
|
|
687
|
+
const modelData = {};
|
|
688
|
+
for (let i = 0; i < sqlColumns.length; i++) {
|
|
689
|
+
const propertyName = entity.columnToPropertyMap.get(sqlColumns[i]);
|
|
690
|
+
<span class="missing-if-branch" title="else path not taken" >E</span>if (propertyName) {
|
|
691
|
+
modelData[propertyName] = values[i];
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
return new Constructor(modelData);
|
|
526
695
|
};
|
|
527
696
|
const getValueBySqlColumn = (model, sqlColumn) => {
|
|
528
|
-
|
|
697
|
+
const entity = orm.getEntityByModel(model);
|
|
698
|
+
const propertyName = entity.columnToPropertyMap.get(sqlColumn);
|
|
699
|
+
return propertyName
|
|
700
|
+
? model[propertyName]
|
|
701
|
+
: <span class="branch-1 cbranch-no" title="branch not covered" >undefined;</span>
|
|
529
702
|
};
|
|
530
703
|
const getSqlColumnForPropertyName = (model, propertyName) => {
|
|
531
|
-
|
|
704
|
+
const entity = orm.getEntityByModel(model);
|
|
705
|
+
const column = entity.propertyToColumnMap.get(propertyName);
|
|
706
|
+
return column;
|
|
532
707
|
};
|
|
533
708
|
/* ------------------------------------------------------------------------*/
|
|
534
709
|
/* Built-in basic CRUD functions ------------------------------------------*/
|
|
535
710
|
/* ------------------------------------------------------------------------*/
|
|
536
711
|
// Standard create
|
|
537
|
-
const create =
|
|
538
|
-
const
|
|
539
|
-
const
|
|
540
|
-
|
|
712
|
+
const create = (model) => {
|
|
713
|
+
const entity = orm.getEntityByModel(model);
|
|
714
|
+
const { columns, values, valuesVar } = getSqlInsertParts(model);
|
|
715
|
+
const query = `
|
|
716
|
+
INSERT INTO "${entity.tableName}" ( ${columns} )
|
|
541
717
|
VALUES ( ${valuesVar} )
|
|
542
|
-
RETURNING ${
|
|
718
|
+
RETURNING ${entity.selectColumnsClause};
|
|
543
719
|
`;
|
|
544
|
-
|
|
720
|
+
return orm.one(query, values);
|
|
545
721
|
};
|
|
546
722
|
// Standard update
|
|
547
|
-
const update =
|
|
548
|
-
const
|
|
549
|
-
const
|
|
550
|
-
|
|
723
|
+
const update = (model, { on = 'id' } = {}) => {
|
|
724
|
+
const entity = orm.getEntityByModel(model);
|
|
725
|
+
const { clause, idVar, values } = getSqlUpdateParts(model, on);
|
|
726
|
+
const query = `
|
|
727
|
+
UPDATE "${entity.tableName}"
|
|
551
728
|
SET ${clause}
|
|
552
|
-
WHERE "${
|
|
553
|
-
RETURNING ${
|
|
729
|
+
WHERE "${entity.tableName}".${getSqlColumnForPropertyName(model, on)} = ${idVar}
|
|
730
|
+
RETURNING ${entity.selectColumnsClause};
|
|
554
731
|
`;
|
|
555
|
-
|
|
732
|
+
return orm.one(query, values);
|
|
556
733
|
};
|
|
557
734
|
// Standard delete
|
|
558
|
-
const _delete =
|
|
559
|
-
const
|
|
560
|
-
const
|
|
561
|
-
|
|
562
|
-
|
|
735
|
+
const _delete = (model) => {
|
|
736
|
+
const entity = orm.getEntityByModel(model);
|
|
737
|
+
const id = model.id;
|
|
738
|
+
const query = `
|
|
739
|
+
DELETE FROM "${entity.tableName}"
|
|
740
|
+
WHERE "${entity.tableName}".id = $(id)
|
|
563
741
|
`;
|
|
564
|
-
|
|
742
|
+
return orm.none(query, { id });
|
|
565
743
|
};
|
|
566
|
-
const deleteMatching =
|
|
567
|
-
const
|
|
568
|
-
const
|
|
569
|
-
|
|
744
|
+
const deleteMatching = (model) => {
|
|
745
|
+
const entity = orm.getEntityByModel(model);
|
|
746
|
+
const { whereClause, values } = getMatchingParts(model);
|
|
747
|
+
const query = `
|
|
748
|
+
DELETE FROM "${entity.tableName}"
|
|
570
749
|
WHERE ${whereClause};
|
|
571
750
|
`;
|
|
572
|
-
|
|
751
|
+
return orm.none(query, values);
|
|
573
752
|
};
|
|
574
|
-
const getMatching =
|
|
575
|
-
const
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
|
|
753
|
+
const getMatching = (model) => {
|
|
754
|
+
const entity = orm.getEntityByModel(model);
|
|
755
|
+
const { whereClause, values } = getMatchingParts(model);
|
|
756
|
+
const query = `
|
|
757
|
+
SELECT ${entity.selectColumnsClause}
|
|
758
|
+
FROM "${entity.tableName}"
|
|
579
759
|
WHERE ${whereClause};
|
|
580
760
|
`;
|
|
581
|
-
|
|
761
|
+
return orm.one(query, values);
|
|
582
762
|
};
|
|
583
|
-
const getOneOrNoneMatching =
|
|
584
|
-
const
|
|
585
|
-
const
|
|
586
|
-
|
|
587
|
-
|
|
763
|
+
const getOneOrNoneMatching = (model) => {
|
|
764
|
+
const entity = orm.getEntityByModel(model);
|
|
765
|
+
const { whereClause, values } = getMatchingParts(model);
|
|
766
|
+
const query = `
|
|
767
|
+
SELECT ${entity.selectColumnsClause}
|
|
768
|
+
FROM "${entity.tableName}"
|
|
588
769
|
WHERE ${whereClause};
|
|
589
770
|
`;
|
|
590
|
-
|
|
771
|
+
return orm.oneOrNone(query, values);
|
|
591
772
|
};
|
|
592
|
-
const getAnyMatching =
|
|
593
|
-
const
|
|
594
|
-
const
|
|
595
|
-
|
|
596
|
-
|
|
773
|
+
const getAnyMatching = (model) => {
|
|
774
|
+
const entity = orm.getEntityByModel(model);
|
|
775
|
+
const { whereClause, values } = getMatchingParts(model);
|
|
776
|
+
const query = `
|
|
777
|
+
SELECT ${entity.selectColumnsClause}
|
|
778
|
+
FROM "${entity.tableName}"
|
|
597
779
|
WHERE ${whereClause};
|
|
598
780
|
`;
|
|
599
|
-
|
|
781
|
+
return orm.any(query, values);
|
|
600
782
|
};
|
|
601
|
-
const getAllMatching =
|
|
602
|
-
const
|
|
603
|
-
const
|
|
604
|
-
|
|
605
|
-
|
|
783
|
+
const getAllMatching = (model) => {
|
|
784
|
+
const entity = orm.getEntityByModel(model);
|
|
785
|
+
const { whereClause, values } = getMatchingParts(model);
|
|
786
|
+
const query = `
|
|
787
|
+
SELECT ${entity.selectColumnsClause}
|
|
788
|
+
FROM "${entity.tableName}"
|
|
606
789
|
WHERE ${whereClause};
|
|
607
790
|
`;
|
|
608
|
-
|
|
791
|
+
return orm.many(query, values);
|
|
609
792
|
};
|
|
610
793
|
return Object.assign({}, orm, {
|
|
611
794
|
// Built-in basic CRUD functions
|
|
@@ -634,7 +817,7 @@ exports.create = create;
|
|
|
634
817
|
</div><!-- /wrapper -->
|
|
635
818
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
636
819
|
Code coverage
|
|
637
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
820
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Sun Mar 01 2026 17:10:47 GMT-0500 (Eastern Standard Time)
|
|
638
821
|
</div>
|
|
639
822
|
</div>
|
|
640
823
|
<script src="../../prettify.js"></script>
|