pure-orm 4.0.0 → 4.0.2
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/README.md +97 -43
- package/coverage/clover.xml +969 -626
- package/coverage/coverage-final.json +34 -22
- package/coverage/lcov-report/dist/src/core.js.html +220 -190
- package/coverage/lcov-report/dist/src/driver-integrations/index.html +97 -0
- package/coverage/lcov-report/dist/src/driver-integrations/pgp.js.html +240 -0
- package/coverage/lcov-report/dist/src/index.html +44 -18
- package/coverage/lcov-report/dist/src/index.js.html +2 -2
- package/coverage/lcov-report/dist/src/orm.js.html +125 -119
- 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 +7 -7
- 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 +4 -4
- 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 +1 -1
- package/coverage/lcov-report/dist/test-utils/five/models/order.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/five/models/parcel-event.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/five/models/parcel-line-item.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/five/models/parcel.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/fourteen/entities.js.html +87 -0
- package/coverage/lcov-report/dist/test-utils/fourteen/index.html +97 -0
- package/coverage/lcov-report/dist/test-utils/fourteen/models/customer.js.html +159 -0
- package/coverage/lcov-report/dist/test-utils/fourteen/models/index.html +110 -0
- package/coverage/lcov-report/dist/test-utils/fourteen/models/person.js.html +138 -0
- 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 +1 -1
- package/coverage/lcov-report/dist/test-utils/nine/models/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/entities.js.html +11 -11
- package/coverage/lcov-report/dist/test-utils/order/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/models/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/models/line-item.js.html +24 -24
- package/coverage/lcov-report/dist/test-utils/order/models/order.js.html +42 -42
- package/coverage/lcov-report/dist/test-utils/order/models/product-variant.js.html +23 -23
- 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 +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/color.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/customer.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/gender.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/inventory-level.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/line-item.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/order.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/parcel-event.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/parcel-line-item.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/parcel.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/physical-address.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/product-variant-image.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/product-variant.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/product.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/refund.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/shipment-actual-product-variant.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/shipment.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/size.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/utm-medium.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/models/utm-source.js.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/dist/test-utils/six/models/index.html +1 -1
- package/coverage/lcov-report/dist/test-utils/six/models/line-item.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/six/models/order.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/six/models/parcel-line-item.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/six/models/parcel.js.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/models/brand.js.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/models/member.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/models/passion.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/models/product.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/models/recommendation-audience.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/models/recommendation.js.html +1 -1
- 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 +1 -1
- 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 +105 -27
- package/coverage/lcov-report/src/core.ts.html +235 -196
- package/coverage/lcov-report/src/driver-integrations/index.html +97 -0
- package/coverage/lcov-report/src/driver-integrations/pgp.ts.html +345 -0
- package/coverage/lcov-report/src/index.html +44 -18
- package/coverage/lcov-report/src/index.ts.html +3 -15
- package/coverage/lcov-report/src/orm.ts.html +256 -130
- 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 +7 -7
- 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 +4 -4
- 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 +1 -1
- package/coverage/lcov-report/test-utils/five/models/order.ts.html +1 -1
- package/coverage/lcov-report/test-utils/five/models/parcel-event.ts.html +1 -1
- package/coverage/lcov-report/test-utils/five/models/parcel-line-item.ts.html +1 -1
- package/coverage/lcov-report/test-utils/five/models/parcel.ts.html +1 -1
- package/coverage/lcov-report/test-utils/fourteen/entities.ts.html +78 -0
- package/coverage/lcov-report/test-utils/fourteen/index.html +97 -0
- package/coverage/lcov-report/test-utils/fourteen/models/customer.ts.html +177 -0
- package/coverage/lcov-report/test-utils/fourteen/models/index.html +110 -0
- package/coverage/lcov-report/test-utils/fourteen/models/person.ts.html +150 -0
- 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 +1 -1
- package/coverage/lcov-report/test-utils/nine/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/order/entities.ts.html +5 -5
- package/coverage/lcov-report/test-utils/order/index.html +1 -1
- package/coverage/lcov-report/test-utils/order/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/order/models/line-item.ts.html +18 -18
- package/coverage/lcov-report/test-utils/order/models/order.ts.html +37 -37
- package/coverage/lcov-report/test-utils/order/models/product-variant.ts.html +18 -18
- 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 +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/color.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/customer.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/gender.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/inventory-level.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/line-item.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/order.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/parcel-event.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/parcel-line-item.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/parcel.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/physical-address.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/product-variant-image.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/product-variant.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/product.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/refund.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/shipment-actual-product-variant.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/shipment.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/size.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/utm-medium.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/models/utm-source.ts.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/test-utils/six/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/six/models/line-item.ts.html +1 -1
- package/coverage/lcov-report/test-utils/six/models/order.ts.html +1 -1
- package/coverage/lcov-report/test-utils/six/models/parcel-line-item.ts.html +1 -1
- package/coverage/lcov-report/test-utils/six/models/parcel.ts.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/brand.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/category.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/member.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/passion.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/product.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/recommendation-audience.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/models/recommendation.ts.html +1 -1
- 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 +1 -1
- 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 +1686 -1005
- package/dist/src/core.d.ts +1 -1
- package/dist/src/core.js +18 -8
- package/dist/src/core.spec.js +643 -540
- package/dist/src/driver-integrations/index.d.ts +1 -0
- package/dist/src/orm.d.ts +21 -0
- package/dist/src/orm.js +6 -2
- package/dist/src/orm.spec.d.ts +1 -0
- package/dist/src/orm.spec.js +102 -0
- package/dist/test-utils/fourteen/entities.d.ts +6 -0
- package/dist/test-utils/fourteen/entities.js +6 -0
- package/dist/test-utils/fourteen/entities.ts +3 -0
- package/dist/test-utils/fourteen/models/customer.d.ts +19 -0
- package/dist/test-utils/fourteen/models/customer.js +30 -0
- package/dist/test-utils/fourteen/models/customer.ts +36 -0
- package/dist/test-utils/fourteen/models/person.d.ts +17 -0
- package/dist/test-utils/fourteen/models/person.js +23 -0
- package/dist/test-utils/fourteen/models/person.ts +27 -0
- package/dist/test-utils/fourteen/results.json +8 -0
- package/dist/test-utils/order/entities.js +2 -2
- package/dist/test-utils/order/entities.ts +2 -2
- package/dist/test-utils/order/models/order.js +1 -1
- package/dist/test-utils/order/models/order.ts +1 -1
- package/package.json +1 -1
- package/src/core.spec.ts +1112 -986
- package/src/core.ts +27 -14
- package/src/driver-integrations/index.ts +2 -0
- package/src/orm.spec.ts +113 -0
- package/src/orm.ts +54 -8
- package/test-utils/fourteen/entities.ts +3 -0
- package/test-utils/fourteen/models/customer.ts +36 -0
- package/test-utils/fourteen/models/person.ts +27 -0
- package/test-utils/fourteen/results.json +8 -0
- package/test-utils/order/entities.ts +2 -2
- package/test-utils/order/models/order.ts +1 -1
|
@@ -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">64.44% </span>
|
|
24
24
|
<span class="quiet">Statements</span>
|
|
25
|
-
<span class='fraction'>
|
|
25
|
+
<span class='fraction'>58/90</span>
|
|
26
26
|
</div>
|
|
27
27
|
<div class='fl pad1y space-right2'>
|
|
28
|
-
<span class="strong">
|
|
28
|
+
<span class="strong">76.92% </span>
|
|
29
29
|
<span class="quiet">Branches</span>
|
|
30
|
-
<span class='fraction'>
|
|
30
|
+
<span class='fraction'>10/13</span>
|
|
31
31
|
</div>
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">71.05% </span>
|
|
34
34
|
<span class="quiet">Functions</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>27/38</span>
|
|
36
36
|
</div>
|
|
37
37
|
<div class='fl pad1y space-right2'>
|
|
38
|
-
<span class="strong">
|
|
38
|
+
<span class="strong">64.44% </span>
|
|
39
39
|
<span class="quiet">Lines</span>
|
|
40
|
-
<span class='fraction'>
|
|
40
|
+
<span class='fraction'>58/90</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 medium'></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>
|
|
@@ -341,7 +341,49 @@
|
|
|
341
341
|
<a name='L293'></a><a href='#L293'>293</a>
|
|
342
342
|
<a name='L294'></a><a href='#L294'>294</a>
|
|
343
343
|
<a name='L295'></a><a href='#L295'>295</a>
|
|
344
|
-
<a name='L296'></a><a href='#L296'>296</a
|
|
344
|
+
<a name='L296'></a><a href='#L296'>296</a>
|
|
345
|
+
<a name='L297'></a><a href='#L297'>297</a>
|
|
346
|
+
<a name='L298'></a><a href='#L298'>298</a>
|
|
347
|
+
<a name='L299'></a><a href='#L299'>299</a>
|
|
348
|
+
<a name='L300'></a><a href='#L300'>300</a>
|
|
349
|
+
<a name='L301'></a><a href='#L301'>301</a>
|
|
350
|
+
<a name='L302'></a><a href='#L302'>302</a>
|
|
351
|
+
<a name='L303'></a><a href='#L303'>303</a>
|
|
352
|
+
<a name='L304'></a><a href='#L304'>304</a>
|
|
353
|
+
<a name='L305'></a><a href='#L305'>305</a>
|
|
354
|
+
<a name='L306'></a><a href='#L306'>306</a>
|
|
355
|
+
<a name='L307'></a><a href='#L307'>307</a>
|
|
356
|
+
<a name='L308'></a><a href='#L308'>308</a>
|
|
357
|
+
<a name='L309'></a><a href='#L309'>309</a>
|
|
358
|
+
<a name='L310'></a><a href='#L310'>310</a>
|
|
359
|
+
<a name='L311'></a><a href='#L311'>311</a>
|
|
360
|
+
<a name='L312'></a><a href='#L312'>312</a>
|
|
361
|
+
<a name='L313'></a><a href='#L313'>313</a>
|
|
362
|
+
<a name='L314'></a><a href='#L314'>314</a>
|
|
363
|
+
<a name='L315'></a><a href='#L315'>315</a>
|
|
364
|
+
<a name='L316'></a><a href='#L316'>316</a>
|
|
365
|
+
<a name='L317'></a><a href='#L317'>317</a>
|
|
366
|
+
<a name='L318'></a><a href='#L318'>318</a>
|
|
367
|
+
<a name='L319'></a><a href='#L319'>319</a>
|
|
368
|
+
<a name='L320'></a><a href='#L320'>320</a>
|
|
369
|
+
<a name='L321'></a><a href='#L321'>321</a>
|
|
370
|
+
<a name='L322'></a><a href='#L322'>322</a>
|
|
371
|
+
<a name='L323'></a><a href='#L323'>323</a>
|
|
372
|
+
<a name='L324'></a><a href='#L324'>324</a>
|
|
373
|
+
<a name='L325'></a><a href='#L325'>325</a>
|
|
374
|
+
<a name='L326'></a><a href='#L326'>326</a>
|
|
375
|
+
<a name='L327'></a><a href='#L327'>327</a>
|
|
376
|
+
<a name='L328'></a><a href='#L328'>328</a>
|
|
377
|
+
<a name='L329'></a><a href='#L329'>329</a>
|
|
378
|
+
<a name='L330'></a><a href='#L330'>330</a>
|
|
379
|
+
<a name='L331'></a><a href='#L331'>331</a>
|
|
380
|
+
<a name='L332'></a><a href='#L332'>332</a>
|
|
381
|
+
<a name='L333'></a><a href='#L333'>333</a>
|
|
382
|
+
<a name='L334'></a><a href='#L334'>334</a>
|
|
383
|
+
<a name='L335'></a><a href='#L335'>335</a>
|
|
384
|
+
<a name='L336'></a><a href='#L336'>336</a>
|
|
385
|
+
<a name='L337'></a><a href='#L337'>337</a>
|
|
386
|
+
<a name='L338'></a><a href='#L338'>338</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
345
387
|
<span class="cline-any cline-neutral"> </span>
|
|
346
388
|
<span class="cline-any cline-neutral"> </span>
|
|
347
389
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -374,14 +416,11 @@
|
|
|
374
416
|
<span class="cline-any cline-neutral"> </span>
|
|
375
417
|
<span class="cline-any cline-neutral"> </span>
|
|
376
418
|
<span class="cline-any cline-neutral"> </span>
|
|
377
|
-
<span class="cline-any cline-yes">1x</span>
|
|
378
419
|
<span class="cline-any cline-neutral"> </span>
|
|
379
420
|
<span class="cline-any cline-neutral"> </span>
|
|
380
421
|
<span class="cline-any cline-neutral"> </span>
|
|
381
422
|
<span class="cline-any cline-neutral"> </span>
|
|
382
423
|
<span class="cline-any cline-neutral"> </span>
|
|
383
|
-
<span class="cline-any cline-yes">8x</span>
|
|
384
|
-
<span class="cline-any cline-yes">8x</span>
|
|
385
424
|
<span class="cline-any cline-neutral"> </span>
|
|
386
425
|
<span class="cline-any cline-neutral"> </span>
|
|
387
426
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -397,113 +436,146 @@
|
|
|
397
436
|
<span class="cline-any cline-neutral"> </span>
|
|
398
437
|
<span class="cline-any cline-neutral"> </span>
|
|
399
438
|
<span class="cline-any cline-neutral"> </span>
|
|
400
|
-
<span class="cline-any cline-yes">8x</span>
|
|
401
|
-
<span class="cline-any cline-no"> </span>
|
|
402
439
|
<span class="cline-any cline-neutral"> </span>
|
|
403
440
|
<span class="cline-any cline-neutral"> </span>
|
|
404
441
|
<span class="cline-any cline-neutral"> </span>
|
|
405
|
-
<span class="cline-any cline-no"> </span>
|
|
406
442
|
<span class="cline-any cline-neutral"> </span>
|
|
443
|
+
<span class="cline-any cline-yes">1x</span>
|
|
407
444
|
<span class="cline-any cline-neutral"> </span>
|
|
408
445
|
<span class="cline-any cline-neutral"> </span>
|
|
409
446
|
<span class="cline-any cline-neutral"> </span>
|
|
410
447
|
<span class="cline-any cline-neutral"> </span>
|
|
411
|
-
<span class="cline-any cline-
|
|
448
|
+
<span class="cline-any cline-yes">6x</span>
|
|
412
449
|
<span class="cline-any cline-neutral"> </span>
|
|
413
|
-
<span class="cline-any cline-no"> </span>
|
|
414
450
|
<span class="cline-any cline-neutral"> </span>
|
|
451
|
+
<span class="cline-any cline-yes">6x</span>
|
|
452
|
+
<span class="cline-any cline-yes">6x</span>
|
|
415
453
|
<span class="cline-any cline-neutral"> </span>
|
|
416
454
|
<span class="cline-any cline-no"> </span>
|
|
417
455
|
<span class="cline-any cline-neutral"> </span>
|
|
418
|
-
<span class="cline-any cline-no"> </span>
|
|
419
|
-
<span class="cline-any cline-no"> </span>
|
|
420
|
-
<span class="cline-any cline-no"> </span>
|
|
421
456
|
<span class="cline-any cline-neutral"> </span>
|
|
422
|
-
<span class="cline-any cline-no"> </span>
|
|
423
457
|
<span class="cline-any cline-neutral"> </span>
|
|
424
458
|
<span class="cline-any cline-neutral"> </span>
|
|
425
|
-
<span class="cline-any cline-yes">8x</span>
|
|
426
|
-
<span class="cline-any cline-no"> </span>
|
|
427
459
|
<span class="cline-any cline-neutral"> </span>
|
|
428
460
|
<span class="cline-any cline-neutral"> </span>
|
|
429
461
|
<span class="cline-any cline-neutral"> </span>
|
|
430
|
-
<span class="cline-any cline-no"> </span>
|
|
431
462
|
<span class="cline-any cline-neutral"> </span>
|
|
463
|
+
<span class="cline-any cline-yes">6x</span>
|
|
432
464
|
<span class="cline-any cline-neutral"> </span>
|
|
433
465
|
<span class="cline-any cline-neutral"> </span>
|
|
466
|
+
<span class="cline-any cline-yes">1x</span>
|
|
434
467
|
<span class="cline-any cline-neutral"> </span>
|
|
435
468
|
<span class="cline-any cline-neutral"> </span>
|
|
436
469
|
<span class="cline-any cline-neutral"> </span>
|
|
437
|
-
<span class="cline-any cline-
|
|
470
|
+
<span class="cline-any cline-yes">24x</span>
|
|
438
471
|
<span class="cline-any cline-neutral"> </span>
|
|
439
|
-
<span class="cline-any cline-no"> </span>
|
|
440
|
-
<span class="cline-any cline-no"> </span>
|
|
441
|
-
<span class="cline-any cline-no"> </span>
|
|
442
472
|
<span class="cline-any cline-neutral"> </span>
|
|
443
473
|
<span class="cline-any cline-neutral"> </span>
|
|
444
|
-
<span class="cline-any cline-no"> </span>
|
|
445
474
|
<span class="cline-any cline-neutral"> </span>
|
|
446
|
-
<span class="cline-any cline-no"> </span>
|
|
447
|
-
<span class="cline-any cline-no"> </span>
|
|
448
|
-
<span class="cline-any cline-no"> </span>
|
|
449
475
|
<span class="cline-any cline-neutral"> </span>
|
|
476
|
+
<span class="cline-any cline-yes">4x</span>
|
|
450
477
|
<span class="cline-any cline-neutral"> </span>
|
|
451
|
-
<span class="cline-any cline-yes">
|
|
452
|
-
<span class="cline-any cline-no"> </span>
|
|
478
|
+
<span class="cline-any cline-yes">1x</span>
|
|
453
479
|
<span class="cline-any cline-neutral"> </span>
|
|
454
480
|
<span class="cline-any cline-neutral"> </span>
|
|
455
|
-
<span class="cline-any cline-
|
|
481
|
+
<span class="cline-any cline-yes">24x</span>
|
|
456
482
|
<span class="cline-any cline-neutral"> </span>
|
|
483
|
+
<span class="cline-any cline-yes">24x</span>
|
|
484
|
+
<span class="cline-any cline-yes">1x</span>
|
|
485
|
+
<span class="cline-any cline-yes">4x</span>
|
|
457
486
|
<span class="cline-any cline-neutral"> </span>
|
|
487
|
+
<span class="cline-any cline-yes">1x</span>
|
|
458
488
|
<span class="cline-any cline-neutral"> </span>
|
|
459
489
|
<span class="cline-any cline-neutral"> </span>
|
|
490
|
+
<span class="cline-any cline-yes">6x</span>
|
|
460
491
|
<span class="cline-any cline-neutral"> </span>
|
|
461
|
-
<span class="cline-any cline-no"> </span>
|
|
462
|
-
<span class="cline-any cline-no"> </span>
|
|
463
492
|
<span class="cline-any cline-neutral"> </span>
|
|
464
|
-
<span class="cline-any cline-no"> </span>
|
|
465
493
|
<span class="cline-any cline-neutral"> </span>
|
|
494
|
+
<span class="cline-any cline-yes">1x</span>
|
|
466
495
|
<span class="cline-any cline-neutral"> </span>
|
|
467
|
-
<span class="cline-any cline-no"> </span>
|
|
468
496
|
<span class="cline-any cline-neutral"> </span>
|
|
469
497
|
<span class="cline-any cline-neutral"> </span>
|
|
498
|
+
<span class="cline-any cline-yes">24x</span>
|
|
470
499
|
<span class="cline-any cline-neutral"> </span>
|
|
471
|
-
<span class="cline-any cline-no"> </span>
|
|
472
|
-
<span class="cline-any cline-no"> </span>
|
|
473
500
|
<span class="cline-any cline-neutral"> </span>
|
|
474
501
|
<span class="cline-any cline-neutral"> </span>
|
|
475
502
|
<span class="cline-any cline-neutral"> </span>
|
|
476
503
|
<span class="cline-any cline-neutral"> </span>
|
|
477
|
-
<span class="cline-any cline-yes">8x</span>
|
|
478
|
-
<span class="cline-any cline-no"> </span>
|
|
479
504
|
<span class="cline-any cline-neutral"> </span>
|
|
505
|
+
<span class="cline-any cline-yes">4x</span>
|
|
480
506
|
<span class="cline-any cline-neutral"> </span>
|
|
481
|
-
<span class="cline-any cline-
|
|
507
|
+
<span class="cline-any cline-yes">1x</span>
|
|
508
|
+
<span class="cline-any cline-yes">1x</span>
|
|
509
|
+
<span class="cline-any cline-yes">1x</span>
|
|
482
510
|
<span class="cline-any cline-neutral"> </span>
|
|
483
511
|
<span class="cline-any cline-neutral"> </span>
|
|
512
|
+
<span class="cline-any cline-yes">24x</span>
|
|
484
513
|
<span class="cline-any cline-neutral"> </span>
|
|
514
|
+
<span class="cline-any cline-yes">24x</span>
|
|
515
|
+
<span class="cline-any cline-yes">1x</span>
|
|
516
|
+
<span class="cline-any cline-yes">1x</span>
|
|
485
517
|
<span class="cline-any cline-neutral"> </span>
|
|
486
518
|
<span class="cline-any cline-neutral"> </span>
|
|
487
|
-
<span class="cline-any cline-
|
|
488
|
-
<span class="cline-any cline-no"> </span>
|
|
519
|
+
<span class="cline-any cline-yes">6x</span>
|
|
489
520
|
<span class="cline-any cline-neutral"> </span>
|
|
490
|
-
<span class="cline-any cline-no"> </span>
|
|
491
521
|
<span class="cline-any cline-neutral"> </span>
|
|
522
|
+
<span class="cline-any cline-yes">1x</span>
|
|
492
523
|
<span class="cline-any cline-neutral"> </span>
|
|
493
|
-
<span class="cline-any cline-no"> </span>
|
|
494
524
|
<span class="cline-any cline-neutral"> </span>
|
|
525
|
+
<span class="cline-any cline-yes">24x</span>
|
|
495
526
|
<span class="cline-any cline-neutral"> </span>
|
|
496
527
|
<span class="cline-any cline-neutral"> </span>
|
|
497
|
-
<span class="cline-any cline-no"> </span>
|
|
498
528
|
<span class="cline-any cline-neutral"> </span>
|
|
499
529
|
<span class="cline-any cline-neutral"> </span>
|
|
500
|
-
<span class="cline-any cline-no"> </span>
|
|
501
530
|
<span class="cline-any cline-neutral"> </span>
|
|
531
|
+
<span class="cline-any cline-yes">24x</span>
|
|
532
|
+
<span class="cline-any cline-yes">4x</span>
|
|
502
533
|
<span class="cline-any cline-neutral"> </span>
|
|
503
|
-
<span class="cline-any cline-
|
|
534
|
+
<span class="cline-any cline-yes">1x</span>
|
|
535
|
+
<span class="cline-any cline-neutral"> </span>
|
|
536
|
+
<span class="cline-any cline-neutral"> </span>
|
|
537
|
+
<span class="cline-any cline-yes">24x</span>
|
|
538
|
+
<span class="cline-any cline-neutral"> </span>
|
|
539
|
+
<span class="cline-any cline-neutral"> </span>
|
|
540
|
+
<span class="cline-any cline-neutral"> </span>
|
|
541
|
+
<span class="cline-any cline-yes">24x</span>
|
|
542
|
+
<span class="cline-any cline-yes">1x</span>
|
|
504
543
|
<span class="cline-any cline-neutral"> </span>
|
|
505
544
|
<span class="cline-any cline-neutral"> </span>
|
|
506
|
-
<span class="cline-any cline-
|
|
545
|
+
<span class="cline-any cline-neutral"> </span>
|
|
546
|
+
<span class="cline-any cline-neutral"> </span>
|
|
547
|
+
<span class="cline-any cline-yes">6x</span>
|
|
548
|
+
<span class="cline-any cline-neutral"> </span>
|
|
549
|
+
<span class="cline-any cline-neutral"> </span>
|
|
550
|
+
<span class="cline-any cline-yes">1x</span>
|
|
551
|
+
<span class="cline-any cline-neutral"> </span>
|
|
552
|
+
<span class="cline-any cline-neutral"> </span>
|
|
553
|
+
<span class="cline-any cline-yes">24x</span>
|
|
554
|
+
<span class="cline-any cline-neutral"> </span>
|
|
555
|
+
<span class="cline-any cline-neutral"> </span>
|
|
556
|
+
<span class="cline-any cline-neutral"> </span>
|
|
557
|
+
<span class="cline-any cline-neutral"> </span>
|
|
558
|
+
<span class="cline-any cline-neutral"> </span>
|
|
559
|
+
<span class="cline-any cline-yes">24x</span>
|
|
560
|
+
<span class="cline-any cline-yes">4x</span>
|
|
561
|
+
<span class="cline-any cline-neutral"> </span>
|
|
562
|
+
<span class="cline-any cline-yes">1x</span>
|
|
563
|
+
<span class="cline-any cline-neutral"> </span>
|
|
564
|
+
<span class="cline-any cline-neutral"> </span>
|
|
565
|
+
<span class="cline-any cline-yes">24x</span>
|
|
566
|
+
<span class="cline-any cline-neutral"> </span>
|
|
567
|
+
<span class="cline-any cline-neutral"> </span>
|
|
568
|
+
<span class="cline-any cline-neutral"> </span>
|
|
569
|
+
<span class="cline-any cline-yes">24x</span>
|
|
570
|
+
<span class="cline-any cline-neutral"> </span>
|
|
571
|
+
<span class="cline-any cline-neutral"> </span>
|
|
572
|
+
<span class="cline-any cline-yes">4x</span>
|
|
573
|
+
<span class="cline-any cline-neutral"> </span>
|
|
574
|
+
<span class="cline-any cline-neutral"> </span>
|
|
575
|
+
<span class="cline-any cline-yes">1x</span>
|
|
576
|
+
<span class="cline-any cline-neutral"> </span>
|
|
577
|
+
<span class="cline-any cline-neutral"> </span>
|
|
578
|
+
<span class="cline-any cline-yes">6x</span>
|
|
507
579
|
<span class="cline-any cline-no"> </span>
|
|
508
580
|
<span class="cline-any cline-no"> </span>
|
|
509
581
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -521,20 +593,29 @@
|
|
|
521
593
|
<span class="cline-any cline-no"> </span>
|
|
522
594
|
<span class="cline-any cline-neutral"> </span>
|
|
523
595
|
<span class="cline-any cline-neutral"> </span>
|
|
524
|
-
<span class="cline-any cline-yes">
|
|
525
|
-
<span class="cline-any cline-
|
|
596
|
+
<span class="cline-any cline-yes">6x</span>
|
|
597
|
+
<span class="cline-any cline-yes">4x</span>
|
|
526
598
|
<span class="cline-any cline-neutral"> </span>
|
|
527
599
|
<span class="cline-any cline-neutral"> </span>
|
|
528
600
|
<span class="cline-any cline-neutral"> </span>
|
|
529
601
|
<span class="cline-any cline-neutral"> </span>
|
|
530
602
|
<span class="cline-any cline-neutral"> </span>
|
|
531
603
|
<span class="cline-any cline-neutral"> </span>
|
|
604
|
+
<span class="cline-any cline-yes">6x</span>
|
|
532
605
|
<span class="cline-any cline-neutral"> </span>
|
|
533
606
|
<span class="cline-any cline-neutral"> </span>
|
|
534
607
|
<span class="cline-any cline-neutral"> </span>
|
|
608
|
+
<span class="cline-any cline-yes">3x</span>
|
|
535
609
|
<span class="cline-any cline-neutral"> </span>
|
|
536
610
|
<span class="cline-any cline-neutral"> </span>
|
|
537
|
-
<span class="cline-any cline-
|
|
611
|
+
<span class="cline-any cline-neutral"> </span>
|
|
612
|
+
<span class="cline-any cline-neutral"> </span>
|
|
613
|
+
<span class="cline-any cline-neutral"> </span>
|
|
614
|
+
<span class="cline-any cline-neutral"> </span>
|
|
615
|
+
<span class="cline-any cline-neutral"> </span>
|
|
616
|
+
<span class="cline-any cline-neutral"> </span>
|
|
617
|
+
<span class="cline-any cline-neutral"> </span>
|
|
618
|
+
<span class="cline-any cline-yes">6x</span>
|
|
538
619
|
<span class="cline-any cline-no"> </span>
|
|
539
620
|
<span class="cline-any cline-no"> </span>
|
|
540
621
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -545,7 +626,7 @@
|
|
|
545
626
|
<span class="cline-any cline-neutral"> </span>
|
|
546
627
|
<span class="cline-any cline-neutral"> </span>
|
|
547
628
|
<span class="cline-any cline-neutral"> </span>
|
|
548
|
-
<span class="cline-any cline-yes">
|
|
629
|
+
<span class="cline-any cline-yes">6x</span>
|
|
549
630
|
<span class="cline-any cline-no"> </span>
|
|
550
631
|
<span class="cline-any cline-no"> </span>
|
|
551
632
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -553,11 +634,13 @@
|
|
|
553
634
|
<span class="cline-any cline-neutral"> </span>
|
|
554
635
|
<span class="cline-any cline-neutral"> </span>
|
|
555
636
|
<span class="cline-any cline-neutral"> </span>
|
|
637
|
+
<span class="cline-any cline-neutral"> </span>
|
|
638
|
+
<span class="cline-any cline-neutral"> </span>
|
|
556
639
|
<span class="cline-any cline-no"> </span>
|
|
557
640
|
<span class="cline-any cline-neutral"> </span>
|
|
558
641
|
<span class="cline-any cline-neutral"> </span>
|
|
559
642
|
<span class="cline-any cline-neutral"> </span>
|
|
560
|
-
<span class="cline-any cline-yes">
|
|
643
|
+
<span class="cline-any cline-yes">6x</span>
|
|
561
644
|
<span class="cline-any cline-no"> </span>
|
|
562
645
|
<span class="cline-any cline-no"> </span>
|
|
563
646
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -566,7 +649,7 @@
|
|
|
566
649
|
<span class="cline-any cline-no"> </span>
|
|
567
650
|
<span class="cline-any cline-neutral"> </span>
|
|
568
651
|
<span class="cline-any cline-neutral"> </span>
|
|
569
|
-
<span class="cline-any cline-yes">
|
|
652
|
+
<span class="cline-any cline-yes">6x</span>
|
|
570
653
|
<span class="cline-any cline-no"> </span>
|
|
571
654
|
<span class="cline-any cline-no"> </span>
|
|
572
655
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -575,7 +658,7 @@
|
|
|
575
658
|
<span class="cline-any cline-no"> </span>
|
|
576
659
|
<span class="cline-any cline-neutral"> </span>
|
|
577
660
|
<span class="cline-any cline-neutral"> </span>
|
|
578
|
-
<span class="cline-any cline-yes">
|
|
661
|
+
<span class="cline-any cline-yes">6x</span>
|
|
579
662
|
<span class="cline-any cline-no"> </span>
|
|
580
663
|
<span class="cline-any cline-no"> </span>
|
|
581
664
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -585,7 +668,7 @@
|
|
|
585
668
|
<span class="cline-any cline-no"> </span>
|
|
586
669
|
<span class="cline-any cline-neutral"> </span>
|
|
587
670
|
<span class="cline-any cline-neutral"> </span>
|
|
588
|
-
<span class="cline-any cline-yes">
|
|
671
|
+
<span class="cline-any cline-yes">6x</span>
|
|
589
672
|
<span class="cline-any cline-no"> </span>
|
|
590
673
|
<span class="cline-any cline-no"> </span>
|
|
591
674
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -595,7 +678,7 @@
|
|
|
595
678
|
<span class="cline-any cline-no"> </span>
|
|
596
679
|
<span class="cline-any cline-neutral"> </span>
|
|
597
680
|
<span class="cline-any cline-neutral"> </span>
|
|
598
|
-
<span class="cline-any cline-yes">
|
|
681
|
+
<span class="cline-any cline-yes">6x</span>
|
|
599
682
|
<span class="cline-any cline-neutral"> </span>
|
|
600
683
|
<span class="cline-any cline-neutral"> </span>
|
|
601
684
|
<span class="cline-any cline-no"> </span>
|
|
@@ -607,7 +690,7 @@
|
|
|
607
690
|
<span class="cline-any cline-no"> </span>
|
|
608
691
|
<span class="cline-any cline-neutral"> </span>
|
|
609
692
|
<span class="cline-any cline-neutral"> </span>
|
|
610
|
-
<span class="cline-any cline-yes">
|
|
693
|
+
<span class="cline-any cline-yes">6x</span>
|
|
611
694
|
<span class="cline-any cline-no"> </span>
|
|
612
695
|
<span class="cline-any cline-no"> </span>
|
|
613
696
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -617,7 +700,8 @@
|
|
|
617
700
|
<span class="cline-any cline-no"> </span>
|
|
618
701
|
<span class="cline-any cline-neutral"> </span>
|
|
619
702
|
<span class="cline-any cline-neutral"> </span>
|
|
620
|
-
<span class="cline-any cline-yes">
|
|
703
|
+
<span class="cline-any cline-yes">6x</span>
|
|
704
|
+
<span class="cline-any cline-neutral"> </span>
|
|
621
705
|
<span class="cline-any cline-neutral"> </span>
|
|
622
706
|
<span class="cline-any cline-neutral"> </span>
|
|
623
707
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -637,8 +721,8 @@
|
|
|
637
721
|
<span class="cline-any cline-neutral"> </span>
|
|
638
722
|
<span class="cline-any cline-neutral"> </span>
|
|
639
723
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { createCore, IModel, ICollection, IEntities } from './core';
|
|
640
|
-
import { ICoreIntegratedDriver } from './
|
|
641
|
-
import { createForPGP } from './
|
|
724
|
+
import { ICoreIntegratedDriver } from './driver-integrations/index';
|
|
725
|
+
import { createForPGP } from './driver-integrations/pgp';
|
|
642
726
|
|
|
643
727
|
export interface ICreateOptions {
|
|
644
728
|
entities: IEntities<IModel>;
|
|
@@ -647,7 +731,6 @@ export interface ICreateOptions {
|
|
|
647
731
|
}
|
|
648
732
|
|
|
649
733
|
export interface IPureORM extends ICoreIntegratedDriver {
|
|
650
|
-
|
|
651
734
|
/* ------------------------------------------------------------------------*/
|
|
652
735
|
/* Built-in basic CRUD functions ------------------------------------------*/
|
|
653
736
|
/* ------------------------------------------------------------------------*/
|
|
@@ -664,9 +747,34 @@ export interface IPureORM extends ICoreIntegratedDriver {
|
|
|
664
747
|
getAnyMatching: <T extends ICollection<IModel>>(model: IModel) => T | void;
|
|
665
748
|
getAllMatching: <T extends ICollection<IModel>>(model: IModel) => T;
|
|
666
749
|
create: <T extends IModel>(model: T) => T;
|
|
667
|
-
update: <T extends IModel>(model: T, options: { on: string }
|
|
750
|
+
update: <T extends IModel>(model: T, options: { on: string }) => T;
|
|
668
751
|
delete: <T extends IModel>(model: T) => void;
|
|
669
752
|
deleteMatching: <T extends IModel>(model: T) => void;
|
|
753
|
+
|
|
754
|
+
/* ------------------------------------------------------------------------*/
|
|
755
|
+
/* Helper Utility Functions -----------------------------------------------*/
|
|
756
|
+
/* ------------------------------------------------------------------------*/
|
|
757
|
+
|
|
758
|
+
getSqlInsertParts: (model: IModel) => {
|
|
759
|
+
columns: string;
|
|
760
|
+
values: Array<string>;
|
|
761
|
+
valuesVar: Array<string>;
|
|
762
|
+
};
|
|
763
|
+
getSqlUpdateParts: (
|
|
764
|
+
model: IModel,
|
|
765
|
+
on?: string
|
|
766
|
+
) => { clause: string; idVar: string; values: Array<string> };
|
|
767
|
+
getMatchingParts: (model: IModel) => {
|
|
768
|
+
whereClause: string;
|
|
769
|
+
values: Array<string>;
|
|
770
|
+
};
|
|
771
|
+
getMatchingPartsObject: (model: IModel) => {
|
|
772
|
+
whereClause: string;
|
|
773
|
+
values: Array<string>;
|
|
774
|
+
};
|
|
775
|
+
getNewWith: (model: IModel, sqlColumns: any, values: any) => IModel;
|
|
776
|
+
getValueBySqlColumn: (model: IModel, sqlColumn: string) => string;
|
|
777
|
+
getSqlColumnForPropertyName: (model: IModel, propertyName: string) => string;
|
|
670
778
|
}
|
|
671
779
|
|
|
672
780
|
export const create = ({
|
|
@@ -674,131 +782,137 @@ export const create = ({
|
|
|
674
782
|
db,
|
|
675
783
|
logError
|
|
676
784
|
}: ICreateOptions): IPureORM => {
|
|
677
|
-
|
|
678
785
|
const core = createCore({ entities: externalEntities });
|
|
679
|
-
const orm = createForPGP({core, db, logError});
|
|
680
786
|
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
createForPGP({core, db, logError});
|
|
787
|
+
let orm: ICoreIntegratedDriver;
|
|
788
|
+
<span class="missing-if-branch" title="else path not taken" >E</span>if (db.$config.pgp) {
|
|
789
|
+
orm = createForPGP({ core, db, logError });
|
|
685
790
|
} else {
|
|
686
|
-
|
|
791
|
+
<span class="cstat-no" title="statement not covered" > throw new Error(</span>
|
|
792
|
+
`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.`
|
|
793
|
+
);
|
|
687
794
|
}
|
|
688
|
-
*/
|
|
689
|
-
|
|
690
795
|
|
|
691
796
|
/* ------------------------------------------------------------------------*/
|
|
692
797
|
/* Helper Utilities for CRUD functions ------------------------------------*/
|
|
693
798
|
/* ------------------------------------------------------------------------*/
|
|
694
799
|
|
|
695
|
-
const getSqlInsertParts =
|
|
696
|
-
|
|
800
|
+
const getSqlInsertParts = (
|
|
801
|
+
model: IModel
|
|
802
|
+
): { columns: string; values: Array<string>; valuesVar: Array<string> } => {
|
|
803
|
+
const columns = orm
|
|
697
804
|
.getEntityByModel(model)
|
|
698
805
|
.columnNames.filter(
|
|
699
|
-
|
|
700
|
-
|
|
806
|
+
(column: string, index: number) =>
|
|
807
|
+
model[
|
|
701
808
|
orm.getEntityByModel(model).propertyNames[
|
|
702
809
|
index
|
|
703
810
|
] as keyof typeof model
|
|
704
811
|
] !== void 0
|
|
705
812
|
)
|
|
706
|
-
.map(
|
|
813
|
+
.map((col: string) => `"${col}"`)
|
|
707
814
|
.join(', ');
|
|
708
|
-
const values =
|
|
815
|
+
const values = orm
|
|
709
816
|
.getEntityByModel(model)
|
|
710
817
|
.propertyNames.map(
|
|
711
|
-
|
|
818
|
+
(property: string) => model[property as keyof typeof model]
|
|
712
819
|
)
|
|
713
|
-
.filter(
|
|
714
|
-
const valuesVar =
|
|
715
|
-
|
|
820
|
+
.filter((value: any) => value !== void 0);
|
|
821
|
+
const valuesVar = values.map(
|
|
822
|
+
(value: any, index: number) => `$${index + 1}`
|
|
716
823
|
);
|
|
717
|
-
|
|
824
|
+
return { columns, values, valuesVar };
|
|
718
825
|
};
|
|
719
826
|
|
|
720
|
-
const getSqlUpdateParts =
|
|
721
|
-
|
|
827
|
+
const getSqlUpdateParts = (
|
|
828
|
+
model: IModel,
|
|
829
|
+
on = 'id'
|
|
830
|
+
): { clause: string; idVar: string; values: Array<string> } => {
|
|
831
|
+
const clauseArray = orm
|
|
722
832
|
.getEntityByModel(model)
|
|
723
833
|
.columnNames.filter(
|
|
724
|
-
|
|
725
|
-
|
|
834
|
+
(sqlColumn: string, index: number) =>
|
|
835
|
+
model[
|
|
726
836
|
orm.getEntityByModel(model).propertyNames[
|
|
727
837
|
index
|
|
728
838
|
] as keyof typeof model
|
|
729
839
|
] !== void 0
|
|
730
840
|
)
|
|
731
841
|
.map(
|
|
732
|
-
|
|
842
|
+
(sqlColumn: string, index: number) => `"${sqlColumn}" = $${index + 1}`
|
|
733
843
|
);
|
|
734
|
-
const clause =
|
|
735
|
-
const idVar =
|
|
736
|
-
const _values =
|
|
844
|
+
const clause = clauseArray.join(', ');
|
|
845
|
+
const idVar = `$${clauseArray.length + 1}`;
|
|
846
|
+
const _values = orm
|
|
737
847
|
.getEntityByModel(model)
|
|
738
848
|
.propertyNames.map(
|
|
739
|
-
|
|
849
|
+
(property: string) => model[property as keyof typeof model]
|
|
740
850
|
)
|
|
741
|
-
.filter(
|
|
742
|
-
const values =
|
|
743
|
-
|
|
851
|
+
.filter((value: any) => value !== void 0);
|
|
852
|
+
const values = [..._values, model[on as keyof typeof model]];
|
|
853
|
+
return { clause, idVar, values };
|
|
744
854
|
};
|
|
745
855
|
|
|
746
|
-
const getMatchingParts =
|
|
747
|
-
|
|
856
|
+
const getMatchingParts = (
|
|
857
|
+
model: IModel
|
|
858
|
+
): { whereClause: string; values: Array<string> } => {
|
|
859
|
+
const whereClause = orm
|
|
748
860
|
.getEntityByModel(model)
|
|
749
|
-
.propertyNames.map(
|
|
750
|
-
|
|
861
|
+
.propertyNames.map((property: string, index: number) =>
|
|
862
|
+
model[property as keyof typeof model] != null
|
|
751
863
|
? `"${orm.getEntityByModel(model).tableName}"."${
|
|
752
864
|
orm.getEntityByModel(model).columnNames[index]
|
|
753
865
|
}"`
|
|
754
866
|
: null
|
|
755
867
|
)
|
|
756
|
-
.filter(
|
|
757
|
-
.map(
|
|
868
|
+
.filter((x: string | null) => x != null)
|
|
869
|
+
.map((x: string | null, i: number) => `${x} = $${i + 1}`)
|
|
758
870
|
.join(' AND ');
|
|
759
|
-
const values =
|
|
871
|
+
const values = orm
|
|
760
872
|
.getEntityByModel(model)
|
|
761
|
-
.propertyNames.map(
|
|
762
|
-
|
|
873
|
+
.propertyNames.map((property: string) =>
|
|
874
|
+
model[property as keyof typeof model] != null
|
|
763
875
|
? model[property as keyof typeof model]
|
|
764
876
|
: null
|
|
765
877
|
)
|
|
766
|
-
.filter(
|
|
767
|
-
|
|
878
|
+
.filter((x: any) => x != null);
|
|
879
|
+
return { whereClause, values };
|
|
768
880
|
};
|
|
769
881
|
|
|
770
882
|
// This one returns an object, which allows it to be more versatile.
|
|
771
883
|
// To-do: make this one even better and use it instead of the one above.
|
|
772
|
-
const getMatchingPartsObject =
|
|
773
|
-
|
|
884
|
+
const getMatchingPartsObject = (
|
|
885
|
+
model: IModel
|
|
886
|
+
): { whereClause: string; values: Array<string> } => {
|
|
887
|
+
const whereClause = orm
|
|
774
888
|
.getEntityByModel(model)
|
|
775
|
-
.propertyNames.map(
|
|
776
|
-
|
|
889
|
+
.propertyNames.map((property: string, index: number) =>
|
|
890
|
+
model[property as keyof typeof model] != null
|
|
777
891
|
? `"${orm.getEntityByModel(model).tableName}"."${
|
|
778
892
|
orm.getEntityByModel(model).columnNames[index]
|
|
779
893
|
}"`
|
|
780
894
|
: null
|
|
781
895
|
)
|
|
782
|
-
.filter(
|
|
783
|
-
.map(
|
|
896
|
+
.filter((x: string | null) => x != null)
|
|
897
|
+
.map((x: string | null, i: number) => `${x} = $(${i + 1})`)
|
|
784
898
|
.join(' AND ');
|
|
785
|
-
const values =
|
|
899
|
+
const values = orm
|
|
786
900
|
.getEntityByModel(model)
|
|
787
|
-
.propertyNames.map(
|
|
788
|
-
|
|
901
|
+
.propertyNames.map((property: string) =>
|
|
902
|
+
model[property as keyof typeof model] != null
|
|
789
903
|
? model[property as keyof typeof model]
|
|
790
904
|
: null
|
|
791
905
|
)
|
|
792
|
-
.filter(
|
|
906
|
+
.filter((x: any) => x != null)
|
|
793
907
|
.reduce(
|
|
794
|
-
|
|
795
|
-
|
|
908
|
+
(accum: any, val: any, index: number) =>
|
|
909
|
+
Object.assign({}, accum, { [index + 1]: val }),
|
|
796
910
|
{}
|
|
797
911
|
);
|
|
798
|
-
|
|
912
|
+
return { whereClause, values };
|
|
799
913
|
};
|
|
800
914
|
|
|
801
|
-
const getNewWith = <span class="fstat-no" title="function not covered" >(m</span>odel: IModel, sqlColumns: any, values: any) => {
|
|
915
|
+
const getNewWith = <span class="fstat-no" title="function not covered" >(m</span>odel: IModel, sqlColumns: any, values: any): IModel => {
|
|
802
916
|
const Constructor = <span class="cstat-no" title="statement not covered" >model.constructor as any;</span>
|
|
803
917
|
const modelKeys = <span class="cstat-no" title="statement not covered" >sqlColumns.map(</span>
|
|
804
918
|
<span class="fstat-no" title="function not covered" > (k</span>ey: string) =>
|
|
@@ -816,13 +930,22 @@ export const create = ({
|
|
|
816
930
|
<span class="cstat-no" title="statement not covered" > return new Constructor(modelData);</span>
|
|
817
931
|
};
|
|
818
932
|
|
|
819
|
-
const getValueBySqlColumn =
|
|
820
|
-
|
|
933
|
+
const getValueBySqlColumn = (model: IModel, sqlColumn: string): string => {
|
|
934
|
+
return model[
|
|
821
935
|
orm.getEntityByModel(model).propertyNames[
|
|
822
936
|
orm.getEntityByModel(model).columnNames.indexOf(sqlColumn)
|
|
823
937
|
] as keyof typeof model
|
|
824
938
|
];
|
|
825
939
|
};
|
|
940
|
+
|
|
941
|
+
const getSqlColumnForPropertyName = (
|
|
942
|
+
model: IModel,
|
|
943
|
+
propertyName: string
|
|
944
|
+
): string => {
|
|
945
|
+
return orm.getEntityByModel(model).columnNames[
|
|
946
|
+
orm.getEntityByModel(model).propertyNames.indexOf(propertyName)
|
|
947
|
+
];
|
|
948
|
+
};
|
|
826
949
|
|
|
827
950
|
/* ------------------------------------------------------------------------*/
|
|
828
951
|
/* Built-in basic CRUD functions ------------------------------------------*/
|
|
@@ -845,7 +968,9 @@ export const create = ({
|
|
|
845
968
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
846
969
|
UPDATE "${orm.getEntityByModel(model).tableName}"
|
|
847
970
|
SET ${clause}
|
|
848
|
-
WHERE "${
|
|
971
|
+
WHERE "${
|
|
972
|
+
orm.getEntityByModel(model).tableName
|
|
973
|
+
}".${getSqlColumnForPropertyName(model, on)} = ${idVar}
|
|
849
974
|
RETURNING ${orm.getEntityByModel(model).selectColumnsClause};
|
|
850
975
|
`;
|
|
851
976
|
<span class="cstat-no" title="statement not covered" > return orm.one<T>(query, values);</span>
|
|
@@ -928,7 +1053,8 @@ export const create = ({
|
|
|
928
1053
|
getMatchingParts,
|
|
929
1054
|
getMatchingPartsObject,
|
|
930
1055
|
getNewWith,
|
|
931
|
-
getValueBySqlColumn
|
|
1056
|
+
getValueBySqlColumn,
|
|
1057
|
+
getSqlColumnForPropertyName
|
|
932
1058
|
});
|
|
933
1059
|
};
|
|
934
1060
|
</pre></td></tr>
|
|
@@ -937,7 +1063,7 @@ export const create = ({
|
|
|
937
1063
|
</div><!-- /wrapper -->
|
|
938
1064
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
939
1065
|
Code coverage
|
|
940
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
1066
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Sat Dec 23 2023 12:48:55 GMT-0500 (Eastern Standard Time)
|
|
941
1067
|
</div>
|
|
942
1068
|
</div>
|
|
943
1069
|
<script src="../prettify.js"></script>
|