pure-orm 4.0.0-4 → 4.0.0-7
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 +11 -11
- package/coverage/clover.xml +367 -581
- package/coverage/coverage-final.json +18 -20
- package/coverage/lcov-report/dist/src/core.js.html +1014 -0
- package/coverage/lcov-report/dist/src/drivers/index.html +97 -0
- package/coverage/lcov-report/dist/src/drivers/pgp.js.html +240 -0
- package/coverage/lcov-report/dist/src/factory.js.html +298 -187
- package/coverage/lcov-report/dist/src/index.html +20 -33
- package/coverage/lcov-report/dist/src/index.js.html +16 -10
- package/coverage/lcov-report/dist/src/orm.js.html +645 -0
- package/coverage/lcov-report/dist/test-utils/blog/entities.js.html +108 -0
- package/coverage/lcov-report/dist/test-utils/blog/index.html +6 -6
- package/coverage/lcov-report/dist/test-utils/blog/models/article.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/blog/models/article_tag.js.html +1 -1
- 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 +1 -1
- package/coverage/lcov-report/dist/test-utils/blog/models/tag.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/blog/orm.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/five/entities.js.html +114 -0
- package/coverage/lcov-report/dist/test-utils/five/index.html +6 -6
- 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/five/orm.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/nine/entities.js.html +84 -0
- package/coverage/lcov-report/dist/test-utils/nine/index.html +6 -6
- 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/nine/orm.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/entities.js.html +114 -0
- package/coverage/lcov-report/dist/test-utils/order/index.html +6 -6
- 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 +1 -1
- package/coverage/lcov-report/dist/test-utils/order/models/order.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/models/product-variant.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/models/product.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/models/utm-source.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order/orm.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/order-more/entities.js.html +204 -0
- package/coverage/lcov-report/dist/test-utils/order-more/index.html +6 -6
- 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/order-more/orm.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/six/entities.js.html +114 -0
- package/coverage/lcov-report/dist/test-utils/six/index.html +6 -6
- 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/six/orm.js.html +1 -1
- package/coverage/lcov-report/dist/test-utils/thirteen/entities.js.html +132 -0
- package/coverage/lcov-report/dist/test-utils/thirteen/index.html +6 -6
- 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/thirteen/orm.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 +87 -0
- package/coverage/lcov-report/dist/test-utils/twelve/index.html +6 -6
- 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/twelve/orm.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 +47 -47
- package/coverage/lcov-report/src/core.ts.html +1527 -0
- package/coverage/lcov-report/src/drivers/index.html +97 -0
- package/coverage/lcov-report/src/drivers/pgp.ts.html +516 -0
- package/coverage/lcov-report/src/factory.ts.html +448 -247
- package/coverage/lcov-report/src/index.html +20 -33
- package/coverage/lcov-report/src/index.ts.html +23 -5
- package/coverage/lcov-report/src/orm.ts.html +954 -0
- package/coverage/lcov-report/test-utils/blog/entities.ts.html +102 -0
- package/coverage/lcov-report/test-utils/blog/index.html +6 -6
- package/coverage/lcov-report/test-utils/blog/models/article.ts.html +1 -1
- package/coverage/lcov-report/test-utils/blog/models/article_tag.ts.html +1 -1
- package/coverage/lcov-report/test-utils/blog/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/blog/models/person.ts.html +1 -1
- package/coverage/lcov-report/test-utils/blog/models/tag.ts.html +1 -1
- package/coverage/lcov-report/test-utils/blog/orm.ts.html +1 -1
- package/coverage/lcov-report/test-utils/five/entities.ts.html +105 -0
- package/coverage/lcov-report/test-utils/five/index.html +2 -2
- 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/five/orm.ts.html +1 -1
- package/coverage/lcov-report/test-utils/nine/entities.ts.html +75 -0
- package/coverage/lcov-report/test-utils/nine/index.html +2 -2
- 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/nine/orm.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order/entities.ts.html +108 -0
- package/coverage/lcov-report/test-utils/order/index.html +2 -2
- package/coverage/lcov-report/test-utils/order/models/index.html +1 -1
- package/coverage/lcov-report/test-utils/order/models/line-item.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order/models/order.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order/models/product-variant.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order/models/product.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order/models/utm-source.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order/orm.ts.html +1 -1
- package/coverage/lcov-report/test-utils/order-more/entities.ts.html +198 -0
- package/coverage/lcov-report/test-utils/order-more/index.html +2 -2
- 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/order-more/orm.ts.html +1 -1
- package/coverage/lcov-report/test-utils/six/entities.ts.html +105 -0
- package/coverage/lcov-report/test-utils/six/index.html +2 -2
- 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/six/orm.ts.html +1 -1
- package/coverage/lcov-report/test-utils/thirteen/entities.ts.html +123 -0
- package/coverage/lcov-report/test-utils/thirteen/index.html +2 -2
- 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/thirteen/orm.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 +78 -0
- package/coverage/lcov-report/test-utils/twelve/index.html +2 -2
- 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/twelve/orm.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 +713 -1142
- package/dist/example/factories/orm.d.ts +1 -46
- package/dist/example/models/employer.d.ts +1 -1
- package/dist/example/models/job.d.ts +1 -1
- package/dist/example/models/person.d.ts +1 -1
- package/dist/src/core.d.ts +66 -0
- package/dist/src/{factory.js → core.js} +43 -240
- package/dist/src/{factory.spec.d.ts → core.spec.d.ts} +0 -0
- package/dist/src/{factory.spec.js → core.spec.js} +56 -43
- package/dist/src/driver-integrations/index.d.ts +13 -0
- package/dist/src/driver-integrations/index.js +2 -0
- package/dist/src/driver-integrations/pgp.d.ts +2 -0
- package/dist/src/driver-integrations/pgp.js +57 -0
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +5 -3
- package/dist/src/orm.d.ts +20 -0
- package/dist/src/orm.js +190 -0
- package/dist/test-utils/blog/entities.d.ts +1 -0
- package/dist/test-utils/blog/{orm.js → entities.js} +7 -6
- package/dist/test-utils/blog/{orm.ts → entities.ts} +6 -6
- package/dist/test-utils/blog/models/article.d.ts +1 -1
- package/dist/test-utils/blog/models/article_tag.d.ts +1 -1
- package/dist/test-utils/blog/models/person.d.ts +1 -1
- package/dist/test-utils/blog/models/tag.d.ts +1 -1
- package/dist/test-utils/five/entities.d.ts +6 -0
- package/dist/test-utils/five/{orm.js → entities.js} +8 -12
- package/dist/test-utils/five/{orm.ts → entities.ts} +7 -12
- package/dist/test-utils/five/models/line-item.d.ts +1 -1
- package/dist/test-utils/five/models/order.d.ts +1 -1
- package/dist/test-utils/five/models/parcel-event.d.ts +1 -1
- package/dist/test-utils/five/models/parcel-line-item.d.ts +1 -1
- package/dist/test-utils/five/models/parcel.d.ts +1 -1
- package/dist/test-utils/nine/entities.d.ts +6 -0
- package/dist/test-utils/nine/entities.js +5 -0
- package/dist/test-utils/nine/entities.ts +2 -0
- package/dist/test-utils/nine/models/feature-switch.d.ts +1 -1
- package/dist/test-utils/order/entities.d.ts +26 -0
- package/dist/test-utils/order/{orm.js → entities.js} +8 -12
- package/{test-utils/order/orm.ts → dist/test-utils/order/entities.ts} +7 -12
- package/dist/test-utils/order/models/line-item.d.ts +1 -1
- package/dist/test-utils/order/models/order.d.ts +1 -1
- package/dist/test-utils/order/models/product-variant.d.ts +1 -1
- package/dist/test-utils/order/models/product.d.ts +1 -1
- package/dist/test-utils/order/models/utm-source.d.ts +1 -1
- package/dist/test-utils/order-more/entities.d.ts +6 -0
- package/dist/test-utils/order-more/{orm.js → entities.js} +23 -27
- package/dist/test-utils/order-more/{orm.ts → entities.ts} +22 -27
- package/dist/test-utils/order-more/models/actual-product-variant.d.ts +1 -1
- package/dist/test-utils/order-more/models/color.d.ts +1 -1
- package/dist/test-utils/order-more/models/customer.d.ts +1 -1
- package/dist/test-utils/order-more/models/gender.d.ts +1 -1
- package/dist/test-utils/order-more/models/inventory-level.d.ts +1 -1
- package/dist/test-utils/order-more/models/line-item.d.ts +1 -1
- package/dist/test-utils/order-more/models/order.d.ts +1 -1
- package/dist/test-utils/order-more/models/parcel-event.d.ts +1 -1
- package/dist/test-utils/order-more/models/parcel-line-item.d.ts +1 -1
- package/dist/test-utils/order-more/models/parcel.d.ts +1 -1
- package/dist/test-utils/order-more/models/physical-address.d.ts +1 -1
- package/dist/test-utils/order-more/models/product-variant-image.d.ts +1 -1
- package/dist/test-utils/order-more/models/product-variant.d.ts +1 -1
- package/dist/test-utils/order-more/models/product.d.ts +1 -1
- package/dist/test-utils/order-more/models/refund.d.ts +1 -1
- package/dist/test-utils/order-more/models/shipment-actual-product-variant.d.ts +1 -1
- package/dist/test-utils/order-more/models/shipment.d.ts +1 -1
- package/dist/test-utils/order-more/models/size.d.ts +1 -1
- package/dist/test-utils/order-more/models/utm-medium.d.ts +1 -1
- package/dist/test-utils/order-more/models/utm-source.d.ts +1 -1
- package/dist/test-utils/six/entities.d.ts +6 -0
- package/dist/test-utils/six/{orm.js → entities.js} +8 -12
- package/{test-utils/six/orm.ts → dist/test-utils/six/entities.ts} +7 -12
- package/dist/test-utils/six/models/customer.d.ts +1 -1
- package/dist/test-utils/six/models/line-item.d.ts +1 -1
- package/dist/test-utils/six/models/order.d.ts +1 -1
- package/dist/test-utils/six/models/parcel-line-item.d.ts +1 -1
- package/dist/test-utils/six/models/parcel.d.ts +1 -1
- package/dist/test-utils/thirteen/entities.d.ts +6 -0
- package/dist/test-utils/thirteen/{orm.js → entities.js} +11 -15
- package/dist/test-utils/thirteen/{orm.ts → entities.ts} +10 -15
- package/dist/test-utils/thirteen/models/audience.d.ts +1 -1
- package/dist/test-utils/thirteen/models/brand.d.ts +1 -1
- package/dist/test-utils/thirteen/models/category.d.ts +1 -1
- package/dist/test-utils/thirteen/models/member.d.ts +1 -1
- package/dist/test-utils/thirteen/models/passion.d.ts +1 -1
- package/dist/test-utils/thirteen/models/product.d.ts +1 -1
- package/dist/test-utils/thirteen/models/recommendation-audience.d.ts +1 -1
- package/dist/test-utils/thirteen/models/recommendation.d.ts +1 -1
- package/dist/test-utils/twelve/entities.d.ts +6 -0
- package/dist/test-utils/twelve/entities.js +6 -0
- package/dist/test-utils/twelve/entities.ts +3 -0
- package/dist/test-utils/twelve/models/member.d.ts +1 -1
- package/dist/test-utils/twelve/models/prompt.d.ts +1 -1
- package/package.json +4 -3
- package/src/{factory.spec.ts → core.spec.ts} +55 -41
- package/src/{factory.ts → core.ts} +86 -339
- package/src/driver-integrations/index.ts +56 -0
- package/src/driver-integrations/pgp.ts +92 -0
- package/src/index.ts +5 -3
- package/src/orm.ts +291 -0
- package/test-utils/blog/{orm.ts → entities.ts} +6 -6
- package/test-utils/five/{orm.ts → entities.ts} +7 -12
- package/test-utils/nine/entities.ts +2 -0
- package/{dist/test-utils/order/orm.ts → test-utils/order/entities.ts} +7 -12
- package/test-utils/order-more/{orm.ts → entities.ts} +22 -27
- package/{dist/test-utils/six/orm.ts → test-utils/six/entities.ts} +7 -12
- package/test-utils/thirteen/{orm.ts → entities.ts} +10 -15
- package/test-utils/twelve/entities.ts +3 -0
- package/dist/src/factory.d.ts +0 -99
- package/dist/test-utils/blog/orm.d.ts +0 -2
- package/dist/test-utils/five/orm.d.ts +0 -47
- package/dist/test-utils/nine/orm.d.ts +0 -47
- package/dist/test-utils/nine/orm.js +0 -9
- package/dist/test-utils/nine/orm.ts +0 -7
- package/dist/test-utils/order/orm.d.ts +0 -47
- package/dist/test-utils/order-more/orm.d.ts +0 -47
- package/dist/test-utils/six/orm.d.ts +0 -47
- package/dist/test-utils/thirteen/orm.d.ts +0 -47
- package/dist/test-utils/twelve/orm.d.ts +0 -47
- package/dist/test-utils/twelve/orm.js +0 -10
- package/dist/test-utils/twelve/orm.ts +0 -8
- package/test-utils/nine/orm.ts +0 -7
- package/test-utils/twelve/orm.ts +0 -8
|
@@ -20,24 +20,24 @@
|
|
|
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.36% </span>
|
|
24
24
|
<span class="quiet">Statements</span>
|
|
25
|
-
<span class='fraction'>
|
|
25
|
+
<span class='fraction'>186/289</span>
|
|
26
26
|
</div>
|
|
27
27
|
<div class='fl pad1y space-right2'>
|
|
28
|
-
<span class="strong">
|
|
28
|
+
<span class="strong">58.68% </span>
|
|
29
29
|
<span class="quiet">Branches</span>
|
|
30
|
-
<span class='fraction'>
|
|
30
|
+
<span class='fraction'>71/121</span>
|
|
31
31
|
</div>
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">46.
|
|
33
|
+
<span class="strong">46.88% </span>
|
|
34
34
|
<span class="quiet">Functions</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>45/96</span>
|
|
36
36
|
</div>
|
|
37
37
|
<div class='fl pad1y space-right2'>
|
|
38
|
-
<span class="strong">
|
|
38
|
+
<span class="strong">63.24% </span>
|
|
39
39
|
<span class="quiet">Lines</span>
|
|
40
|
-
<span class='fraction'>
|
|
40
|
+
<span class='fraction'>172/272</span>
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
43
43
|
<p class="quiet">
|
|
@@ -558,7 +558,44 @@
|
|
|
558
558
|
<a name='L510'></a><a href='#L510'>510</a>
|
|
559
559
|
<a name='L511'></a><a href='#L511'>511</a>
|
|
560
560
|
<a name='L512'></a><a href='#L512'>512</a>
|
|
561
|
-
<a name='L513'></a><a href='#L513'>513</a
|
|
561
|
+
<a name='L513'></a><a href='#L513'>513</a>
|
|
562
|
+
<a name='L514'></a><a href='#L514'>514</a>
|
|
563
|
+
<a name='L515'></a><a href='#L515'>515</a>
|
|
564
|
+
<a name='L516'></a><a href='#L516'>516</a>
|
|
565
|
+
<a name='L517'></a><a href='#L517'>517</a>
|
|
566
|
+
<a name='L518'></a><a href='#L518'>518</a>
|
|
567
|
+
<a name='L519'></a><a href='#L519'>519</a>
|
|
568
|
+
<a name='L520'></a><a href='#L520'>520</a>
|
|
569
|
+
<a name='L521'></a><a href='#L521'>521</a>
|
|
570
|
+
<a name='L522'></a><a href='#L522'>522</a>
|
|
571
|
+
<a name='L523'></a><a href='#L523'>523</a>
|
|
572
|
+
<a name='L524'></a><a href='#L524'>524</a>
|
|
573
|
+
<a name='L525'></a><a href='#L525'>525</a>
|
|
574
|
+
<a name='L526'></a><a href='#L526'>526</a>
|
|
575
|
+
<a name='L527'></a><a href='#L527'>527</a>
|
|
576
|
+
<a name='L528'></a><a href='#L528'>528</a>
|
|
577
|
+
<a name='L529'></a><a href='#L529'>529</a>
|
|
578
|
+
<a name='L530'></a><a href='#L530'>530</a>
|
|
579
|
+
<a name='L531'></a><a href='#L531'>531</a>
|
|
580
|
+
<a name='L532'></a><a href='#L532'>532</a>
|
|
581
|
+
<a name='L533'></a><a href='#L533'>533</a>
|
|
582
|
+
<a name='L534'></a><a href='#L534'>534</a>
|
|
583
|
+
<a name='L535'></a><a href='#L535'>535</a>
|
|
584
|
+
<a name='L536'></a><a href='#L536'>536</a>
|
|
585
|
+
<a name='L537'></a><a href='#L537'>537</a>
|
|
586
|
+
<a name='L538'></a><a href='#L538'>538</a>
|
|
587
|
+
<a name='L539'></a><a href='#L539'>539</a>
|
|
588
|
+
<a name='L540'></a><a href='#L540'>540</a>
|
|
589
|
+
<a name='L541'></a><a href='#L541'>541</a>
|
|
590
|
+
<a name='L542'></a><a href='#L542'>542</a>
|
|
591
|
+
<a name='L543'></a><a href='#L543'>543</a>
|
|
592
|
+
<a name='L544'></a><a href='#L544'>544</a>
|
|
593
|
+
<a name='L545'></a><a href='#L545'>545</a>
|
|
594
|
+
<a name='L546'></a><a href='#L546'>546</a>
|
|
595
|
+
<a name='L547'></a><a href='#L547'>547</a>
|
|
596
|
+
<a name='L548'></a><a href='#L548'>548</a>
|
|
597
|
+
<a name='L549'></a><a href='#L549'>549</a>
|
|
598
|
+
<a name='L550'></a><a href='#L550'>550</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
562
599
|
<span class="cline-any cline-yes">1x</span>
|
|
563
600
|
<span class="cline-any cline-yes">1x</span>
|
|
564
601
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -629,14 +666,6 @@
|
|
|
629
666
|
<span class="cline-any cline-neutral"> </span>
|
|
630
667
|
<span class="cline-any cline-yes">38207x</span>
|
|
631
668
|
<span class="cline-any cline-neutral"> </span>
|
|
632
|
-
<span class="cline-any cline-yes">8x</span>
|
|
633
|
-
<span class="cline-any cline-no"> </span>
|
|
634
|
-
<span class="cline-any cline-no"> </span>
|
|
635
|
-
<span class="cline-any cline-no"> </span>
|
|
636
|
-
<span class="cline-any cline-neutral"> </span>
|
|
637
|
-
<span class="cline-any cline-neutral"> </span>
|
|
638
|
-
<span class="cline-any cline-no"> </span>
|
|
639
|
-
<span class="cline-any cline-neutral"> </span>
|
|
640
669
|
<span class="cline-any cline-neutral"> </span>
|
|
641
670
|
<span class="cline-any cline-neutral"> </span>
|
|
642
671
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -810,6 +839,9 @@
|
|
|
810
839
|
<span class="cline-any cline-yes">3703x</span>
|
|
811
840
|
<span class="cline-any cline-yes">3703x</span>
|
|
812
841
|
<span class="cline-any cline-yes">3703x</span>
|
|
842
|
+
<span class="cline-any cline-no"> </span>
|
|
843
|
+
<span class="cline-any cline-neutral"> </span>
|
|
844
|
+
<span class="cline-any cline-yes">3703x</span>
|
|
813
845
|
<span class="cline-any cline-yes">3703x</span>
|
|
814
846
|
<span class="cline-any cline-yes">3703x</span>
|
|
815
847
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -825,11 +857,20 @@
|
|
|
825
857
|
<span class="cline-any cline-yes">13x</span>
|
|
826
858
|
<span class="cline-any cline-neutral"> </span>
|
|
827
859
|
<span class="cline-any cline-yes">8x</span>
|
|
828
|
-
<span class="cline-any cline-
|
|
860
|
+
<span class="cline-any cline-no"> </span>
|
|
861
|
+
<span class="cline-any cline-no"> </span>
|
|
862
|
+
<span class="cline-any cline-neutral"> </span>
|
|
863
|
+
<span class="cline-any cline-neutral"> </span>
|
|
864
|
+
<span class="cline-any cline-no"> </span>
|
|
865
|
+
<span class="cline-any cline-neutral"> </span>
|
|
866
|
+
<span class="cline-any cline-no"> </span>
|
|
867
|
+
<span class="cline-any cline-neutral"> </span>
|
|
868
|
+
<span class="cline-any cline-yes">8x</span>
|
|
829
869
|
<span class="cline-any cline-yes">4x</span>
|
|
830
870
|
<span class="cline-any cline-no"> </span>
|
|
831
871
|
<span class="cline-any cline-neutral"> </span>
|
|
832
872
|
<span class="cline-any cline-yes">4x</span>
|
|
873
|
+
<span class="cline-any cline-yes">4x</span>
|
|
833
874
|
<span class="cline-any cline-no"> </span>
|
|
834
875
|
<span class="cline-any cline-neutral"> </span>
|
|
835
876
|
<span class="cline-any cline-yes">4x</span>
|
|
@@ -842,118 +883,169 @@
|
|
|
842
883
|
<span class="cline-any cline-no"> </span>
|
|
843
884
|
<span class="cline-any cline-neutral"> </span>
|
|
844
885
|
<span class="cline-any cline-no"> </span>
|
|
886
|
+
<span class="cline-any cline-neutral"> </span>
|
|
887
|
+
<span class="cline-any cline-yes">8x</span>
|
|
845
888
|
<span class="cline-any cline-no"> </span>
|
|
846
889
|
<span class="cline-any cline-no"> </span>
|
|
847
890
|
<span class="cline-any cline-neutral"> </span>
|
|
848
891
|
<span class="cline-any cline-no"> </span>
|
|
849
892
|
<span class="cline-any cline-neutral"> </span>
|
|
850
893
|
<span class="cline-any cline-yes">8x</span>
|
|
851
|
-
<span class="cline-any cline-no"> </span>
|
|
852
|
-
<span class="cline-any cline-no"> </span>
|
|
853
|
-
<span class="cline-any cline-no"> </span>
|
|
854
894
|
<span class="cline-any cline-neutral"> </span>
|
|
855
|
-
<span class="cline-any cline-no"> </span>
|
|
856
895
|
<span class="cline-any cline-neutral"> </span>
|
|
896
|
+
<span class="cline-any cline-neutral"> </span>
|
|
897
|
+
<span class="cline-any cline-neutral"> </span>
|
|
898
|
+
<span class="cline-any cline-neutral"> </span>
|
|
899
|
+
<span class="cline-any cline-neutral"> </span>
|
|
900
|
+
<span class="cline-any cline-neutral"> </span>
|
|
901
|
+
<span class="cline-any cline-neutral"> </span>
|
|
902
|
+
<span class="cline-any cline-yes">50x</span>
|
|
903
|
+
<span class="cline-any cline-neutral"> </span>
|
|
904
|
+
<span class="cline-any cline-neutral"> </span>
|
|
905
|
+
<span class="cline-any cline-yes">50x</span>
|
|
906
|
+
<span class="cline-any cline-neutral"> </span>
|
|
907
|
+
<span class="cline-any cline-neutral"> </span>
|
|
908
|
+
<span class="cline-any cline-neutral"> </span>
|
|
909
|
+
<span class="cline-any cline-yes">1x</span>
|
|
910
|
+
<span class="cline-any cline-yes">1x</span>
|
|
911
|
+
<span class="cline-any cline-yes">8x</span>
|
|
857
912
|
<span class="cline-any cline-yes">8x</span>
|
|
858
913
|
<span class="cline-any cline-no"> </span>
|
|
859
914
|
<span class="cline-any cline-no"> </span>
|
|
860
915
|
<span class="cline-any cline-no"> </span>
|
|
861
916
|
<span class="cline-any cline-neutral"> </span>
|
|
917
|
+
<span class="cline-any cline-neutral"> </span>
|
|
862
918
|
<span class="cline-any cline-no"> </span>
|
|
863
|
-
<span class="cline-any cline-
|
|
864
|
-
<span class="cline-any cline-
|
|
865
|
-
<span class="cline-any cline-
|
|
866
|
-
<span class="cline-any cline-no"> </span>
|
|
919
|
+
<span class="cline-any cline-neutral"> </span>
|
|
920
|
+
<span class="cline-any cline-neutral"> </span>
|
|
921
|
+
<span class="cline-any cline-neutral"> </span>
|
|
867
922
|
<span class="cline-any cline-neutral"> </span>
|
|
868
923
|
<span class="cline-any cline-yes">8x</span>
|
|
869
924
|
<span class="cline-any cline-no"> </span>
|
|
925
|
+
<span class="cline-any cline-neutral"> </span>
|
|
870
926
|
<span class="cline-any cline-no"> </span>
|
|
871
|
-
<span class="cline-any cline-
|
|
872
|
-
<span class="cline-any cline-no"> </span>
|
|
873
|
-
<span class="cline-any cline-no"> </span>
|
|
874
|
-
<span class="cline-any cline-no"> </span>
|
|
875
|
-
<span class="cline-any cline-no"> </span>
|
|
876
|
-
<span class="cline-any cline-no"> </span>
|
|
877
|
-
<span class="cline-any cline-no"> </span>
|
|
878
|
-
<span class="cline-any cline-no"> </span>
|
|
927
|
+
<span class="cline-any cline-neutral"> </span>
|
|
879
928
|
<span class="cline-any cline-neutral"> </span>
|
|
880
929
|
<span class="cline-any cline-yes">8x</span>
|
|
881
930
|
<span class="cline-any cline-no"> </span>
|
|
931
|
+
<span class="cline-any cline-neutral"> </span>
|
|
882
932
|
<span class="cline-any cline-no"> </span>
|
|
883
933
|
<span class="cline-any cline-neutral"> </span>
|
|
884
934
|
<span class="cline-any cline-neutral"> </span>
|
|
935
|
+
<span class="cline-any cline-yes">8x</span>
|
|
885
936
|
<span class="cline-any cline-no"> </span>
|
|
937
|
+
<span class="cline-any cline-neutral"> </span>
|
|
886
938
|
<span class="cline-any cline-no"> </span>
|
|
887
939
|
<span class="cline-any cline-neutral"> </span>
|
|
940
|
+
<span class="cline-any cline-neutral"> </span>
|
|
941
|
+
<span class="cline-any cline-yes">8x</span>
|
|
888
942
|
<span class="cline-any cline-no"> </span>
|
|
943
|
+
<span class="cline-any cline-neutral"> </span>
|
|
889
944
|
<span class="cline-any cline-no"> </span>
|
|
890
945
|
<span class="cline-any cline-neutral"> </span>
|
|
891
946
|
<span class="cline-any cline-neutral"> </span>
|
|
947
|
+
<span class="cline-any cline-yes">8x</span>
|
|
892
948
|
<span class="cline-any cline-no"> </span>
|
|
949
|
+
<span class="cline-any cline-neutral"> </span>
|
|
893
950
|
<span class="cline-any cline-no"> </span>
|
|
894
951
|
<span class="cline-any cline-neutral"> </span>
|
|
895
952
|
<span class="cline-any cline-neutral"> </span>
|
|
953
|
+
<span class="cline-any cline-yes">8x</span>
|
|
954
|
+
<span class="cline-any cline-neutral"> </span>
|
|
955
|
+
<span class="cline-any cline-neutral"> </span>
|
|
956
|
+
<span class="cline-any cline-neutral"> </span>
|
|
957
|
+
<span class="cline-any cline-neutral"> </span>
|
|
896
958
|
<span class="cline-any cline-neutral"> </span>
|
|
959
|
+
<span class="cline-any cline-neutral"> </span>
|
|
960
|
+
<span class="cline-any cline-neutral"> </span>
|
|
961
|
+
<span class="cline-any cline-neutral"> </span>
|
|
962
|
+
<span class="cline-any cline-neutral"> </span>
|
|
963
|
+
<span class="cline-any cline-neutral"> </span>
|
|
964
|
+
<span class="cline-any cline-yes">1x</span>
|
|
965
|
+
<span class="cline-any cline-yes">1x</span>
|
|
897
966
|
<span class="cline-any cline-yes">8x</span>
|
|
898
|
-
<span class="cline-any cline-no"> </span>
|
|
899
|
-
<span class="cline-any cline-no"> </span>
|
|
900
967
|
<span class="cline-any cline-neutral"> </span>
|
|
901
968
|
<span class="cline-any cline-neutral"> </span>
|
|
902
|
-
<span class="cline-any cline-
|
|
969
|
+
<span class="cline-any cline-neutral"> </span>
|
|
970
|
+
<span class="cline-any cline-neutral"> </span>
|
|
971
|
+
<span class="cline-any cline-neutral"> </span>
|
|
972
|
+
<span class="cline-any cline-neutral"> </span>
|
|
973
|
+
<span class="cline-any cline-neutral"> </span>
|
|
974
|
+
<span class="cline-any cline-yes">8x</span>
|
|
903
975
|
<span class="cline-any cline-no"> </span>
|
|
904
976
|
<span class="cline-any cline-neutral"> </span>
|
|
905
977
|
<span class="cline-any cline-no"> </span>
|
|
906
978
|
<span class="cline-any cline-no"> </span>
|
|
907
979
|
<span class="cline-any cline-neutral"> </span>
|
|
980
|
+
<span class="cline-any cline-no"> </span>
|
|
908
981
|
<span class="cline-any cline-neutral"> </span>
|
|
909
982
|
<span class="cline-any cline-no"> </span>
|
|
910
983
|
<span class="cline-any cline-no"> </span>
|
|
911
984
|
<span class="cline-any cline-no"> </span>
|
|
985
|
+
<span class="cline-any cline-no"> </span>
|
|
912
986
|
<span class="cline-any cline-neutral"> </span>
|
|
913
987
|
<span class="cline-any cline-yes">8x</span>
|
|
914
988
|
<span class="cline-any cline-no"> </span>
|
|
989
|
+
<span class="cline-any cline-neutral"> </span>
|
|
990
|
+
<span class="cline-any cline-no"> </span>
|
|
915
991
|
<span class="cline-any cline-no"> </span>
|
|
916
992
|
<span class="cline-any cline-no"> </span>
|
|
917
993
|
<span class="cline-any cline-no"> </span>
|
|
918
994
|
<span class="cline-any cline-no"> </span>
|
|
919
995
|
<span class="cline-any cline-neutral"> </span>
|
|
920
996
|
<span class="cline-any cline-no"> </span>
|
|
997
|
+
<span class="cline-any cline-no"> </span>
|
|
998
|
+
<span class="cline-any cline-no"> </span>
|
|
999
|
+
<span class="cline-any cline-no"> </span>
|
|
921
1000
|
<span class="cline-any cline-neutral"> </span>
|
|
922
1001
|
<span class="cline-any cline-yes">8x</span>
|
|
923
1002
|
<span class="cline-any cline-no"> </span>
|
|
924
1003
|
<span class="cline-any cline-neutral"> </span>
|
|
1004
|
+
<span class="cline-any cline-no"> </span>
|
|
925
1005
|
<span class="cline-any cline-neutral"> </span>
|
|
926
1006
|
<span class="cline-any cline-neutral"> </span>
|
|
1007
|
+
<span class="cline-any cline-no"> </span>
|
|
1008
|
+
<span class="cline-any cline-no"> </span>
|
|
927
1009
|
<span class="cline-any cline-neutral"> </span>
|
|
928
|
-
<span class="cline-any cline-yes">8x</span>
|
|
929
1010
|
<span class="cline-any cline-no"> </span>
|
|
930
1011
|
<span class="cline-any cline-neutral"> </span>
|
|
931
1012
|
<span class="cline-any cline-no"> </span>
|
|
932
1013
|
<span class="cline-any cline-neutral"> </span>
|
|
933
1014
|
<span class="cline-any cline-neutral"> </span>
|
|
934
|
-
<span class="cline-any cline-yes">8x</span>
|
|
935
1015
|
<span class="cline-any cline-no"> </span>
|
|
936
|
-
<span class="cline-any cline-neutral"> </span>
|
|
937
1016
|
<span class="cline-any cline-no"> </span>
|
|
938
1017
|
<span class="cline-any cline-neutral"> </span>
|
|
939
1018
|
<span class="cline-any cline-neutral"> </span>
|
|
1019
|
+
<span class="cline-any cline-neutral"> </span>
|
|
940
1020
|
<span class="cline-any cline-yes">8x</span>
|
|
941
1021
|
<span class="cline-any cline-no"> </span>
|
|
942
1022
|
<span class="cline-any cline-neutral"> </span>
|
|
943
1023
|
<span class="cline-any cline-no"> </span>
|
|
944
1024
|
<span class="cline-any cline-neutral"> </span>
|
|
945
1025
|
<span class="cline-any cline-neutral"> </span>
|
|
946
|
-
<span class="cline-any cline-
|
|
1026
|
+
<span class="cline-any cline-no"> </span>
|
|
947
1027
|
<span class="cline-any cline-no"> </span>
|
|
948
1028
|
<span class="cline-any cline-neutral"> </span>
|
|
949
1029
|
<span class="cline-any cline-no"> </span>
|
|
950
1030
|
<span class="cline-any cline-neutral"> </span>
|
|
1031
|
+
<span class="cline-any cline-no"> </span>
|
|
1032
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1033
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1034
|
+
<span class="cline-any cline-no"> </span>
|
|
1035
|
+
<span class="cline-any cline-no"> </span>
|
|
1036
|
+
<span class="cline-any cline-no"> </span>
|
|
951
1037
|
<span class="cline-any cline-neutral"> </span>
|
|
952
1038
|
<span class="cline-any cline-yes">8x</span>
|
|
953
1039
|
<span class="cline-any cline-no"> </span>
|
|
1040
|
+
<span class="cline-any cline-no"> </span>
|
|
1041
|
+
<span class="cline-any cline-no"> </span>
|
|
1042
|
+
<span class="cline-any cline-no"> </span>
|
|
1043
|
+
<span class="cline-any cline-no"> </span>
|
|
954
1044
|
<span class="cline-any cline-neutral"> </span>
|
|
955
1045
|
<span class="cline-any cline-no"> </span>
|
|
956
1046
|
<span class="cline-any cline-neutral"> </span>
|
|
1047
|
+
<span class="cline-any cline-yes">8x</span>
|
|
1048
|
+
<span class="cline-any cline-no"> </span>
|
|
957
1049
|
<span class="cline-any cline-neutral"> </span>
|
|
958
1050
|
<span class="cline-any cline-neutral"> </span>
|
|
959
1051
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1051,30 +1143,12 @@
|
|
|
1051
1143
|
<span class="cline-any cline-neutral"> </span>
|
|
1052
1144
|
<span class="cline-any cline-neutral"> </span>
|
|
1053
1145
|
<span class="cline-any cline-neutral"> </span>
|
|
1054
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1055
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1056
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1057
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1058
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1059
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1060
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1061
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1062
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1063
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1064
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1065
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1066
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1067
|
-
<span class="cline-any cline-yes">50x</span>
|
|
1068
|
-
<span class="cline-any cline-yes">50x</span>
|
|
1069
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1070
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1071
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1072
1146
|
<span class="cline-any cline-yes">1x</span>
|
|
1073
1147
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">"use strict";
|
|
1074
1148
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1075
|
-
exports.create = void 0;
|
|
1149
|
+
exports.create = exports.createAbstractionLayer = exports.createOrm = void 0;
|
|
1076
1150
|
const camelCase = require('camelcase');
|
|
1077
|
-
const
|
|
1151
|
+
const createOrm = ({ entities: externalEntities }) => {
|
|
1078
1152
|
const entities = externalEntities.map((d) => {
|
|
1079
1153
|
const tableName = d.tableName;
|
|
1080
1154
|
const displayName = d.displayName || camelCase(d.tableName);
|
|
@@ -1141,14 +1215,6 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
1141
1215
|
}
|
|
1142
1216
|
return entity;
|
|
1143
1217
|
};
|
|
1144
|
-
const defaultErrorHandler = <span class="fstat-no" title="function not covered" >(e</span>rr) => {
|
|
1145
|
-
<span class="cstat-no" title="statement not covered" > if (!(err.name === 'QueryResultError')) {</span>
|
|
1146
|
-
<span class="cstat-no" title="statement not covered" > if (logError) {</span>
|
|
1147
|
-
<span class="cstat-no" title="statement not covered" > logError(err);</span>
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
|
-
<span class="cstat-no" title="statement not covered" > throw err;</span>
|
|
1151
|
-
};
|
|
1152
1218
|
/*
|
|
1153
1219
|
* In:
|
|
1154
1220
|
* [
|
|
@@ -1321,27 +1387,39 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
1321
1387
|
return Object.keys(result).reduce((obj, text) => {
|
|
1322
1388
|
const tableName = text.split('#')[0];
|
|
1323
1389
|
const column = text.split('#')[1];
|
|
1390
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (!tableName || !column) {
|
|
1391
|
+
<span class="cstat-no" title="statement not covered" > throw new Error('Column names must be namespaced to table');</span>
|
|
1392
|
+
}
|
|
1324
1393
|
obj[tableName] = obj[tableName] || {};
|
|
1325
1394
|
obj[tableName][column] = result[text];
|
|
1326
1395
|
return obj;
|
|
1327
1396
|
}, {});
|
|
1328
1397
|
};
|
|
1329
|
-
const createFromDatabase = (
|
|
1330
|
-
const result = Array.isArray(
|
|
1398
|
+
const createFromDatabase = (rows) => {
|
|
1399
|
+
const result = Array.isArray(rows) ? rows : <span class="branch-1 cbranch-no" title="branch not covered" >[rows];</span>
|
|
1331
1400
|
const objectified = result.map(objectifyDatabaseResult);
|
|
1332
1401
|
const boified = objectified.map(mapToBos);
|
|
1333
1402
|
const clumps = clumpIntoGroups(boified);
|
|
1334
1403
|
const nested = clumps.map(nestClump);
|
|
1335
1404
|
const models = nested.map((n) => Object.values(n)[0]);
|
|
1336
1405
|
const Collection = getEntityByModel(models[0]).Collection;
|
|
1337
|
-
return
|
|
1406
|
+
return new Collection({ models });
|
|
1407
|
+
};
|
|
1408
|
+
const createAnyFromDatabase = <span class="fstat-no" title="function not covered" >(r</span>ows, rootKey) => {
|
|
1409
|
+
<span class="cstat-no" title="statement not covered" > if (!rows || !rows.length) {</span>
|
|
1410
|
+
const Collection = <span class="cstat-no" title="statement not covered" >typeof rootKey === 'string'</span>
|
|
1411
|
+
? getEntityByTableName(rootKey).Collection
|
|
1412
|
+
: getEntityByModel(rootKey).Collection;
|
|
1413
|
+
<span class="cstat-no" title="statement not covered" > return new Collection({ models: [] });</span>
|
|
1414
|
+
}
|
|
1415
|
+
<span class="cstat-no" title="statement not covered" > return createFromDatabase(rows);</span>
|
|
1338
1416
|
};
|
|
1339
|
-
const createOneFromDatabase = (
|
|
1340
|
-
|
|
1341
|
-
<span class="missing-if-branch" title="if path not taken" >I</span>if (!collection) {
|
|
1417
|
+
const createOneFromDatabase = (rows) => {
|
|
1418
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (!rows || !rows.length) {
|
|
1342
1419
|
<span class="cstat-no" title="statement not covered" > throw Error('Did not get one.');</span>
|
|
1343
1420
|
}
|
|
1344
|
-
|
|
1421
|
+
const collection = createFromDatabase(rows);
|
|
1422
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (!collection || !collection.models || collection.models.length === 0) {
|
|
1345
1423
|
<span class="cstat-no" title="statement not covered" > throw Error('Did not get one.');</span>
|
|
1346
1424
|
}
|
|
1347
1425
|
else <span class="missing-if-branch" title="if path not taken" >I</span>if (collection.models.length > 1) {
|
|
@@ -1349,55 +1427,137 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
1349
1427
|
}
|
|
1350
1428
|
return collection.models[0];
|
|
1351
1429
|
};
|
|
1352
|
-
const createOneOrNoneFromDatabase = <span class="fstat-no" title="function not covered" >(
|
|
1353
|
-
<span class="cstat-no" title="statement not covered" > if (!
|
|
1354
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
1430
|
+
const createOneOrNoneFromDatabase = <span class="fstat-no" title="function not covered" >(r</span>ows) => {
|
|
1431
|
+
<span class="cstat-no" title="statement not covered" > if (!rows || !rows.length) {</span>
|
|
1432
|
+
<span class="cstat-no" title="statement not covered" > return void 0;</span>
|
|
1355
1433
|
}
|
|
1356
|
-
|
|
1357
|
-
<span class="cstat-no" title="statement not covered" > if (collection && collection.models.length > 1) {</span>
|
|
1358
|
-
<span class="cstat-no" title="statement not covered" > throw Error('Got more than one.');</span>
|
|
1359
|
-
}
|
|
1360
|
-
<span class="cstat-no" title="statement not covered" > return collection && collection.models[0];</span>
|
|
1434
|
+
<span class="cstat-no" title="statement not covered" > return createOneFromDatabase(rows);</span>
|
|
1361
1435
|
};
|
|
1362
|
-
const createManyFromDatabase = <span class="fstat-no" title="function not covered" >(
|
|
1363
|
-
|
|
1364
|
-
<span class="cstat-no" title="statement not covered" > if (!collection || collection.models.length === 0) {</span>
|
|
1436
|
+
const createManyFromDatabase = <span class="fstat-no" title="function not covered" >(r</span>ows) => {
|
|
1437
|
+
<span class="cstat-no" title="statement not covered" > if (!rows || !rows.length) {</span>
|
|
1365
1438
|
<span class="cstat-no" title="statement not covered" > throw Error('Did not get at least one.');</span>
|
|
1366
1439
|
}
|
|
1367
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
1440
|
+
<span class="cstat-no" title="statement not covered" > return createFromDatabase(rows);</span>
|
|
1441
|
+
};
|
|
1442
|
+
return {
|
|
1443
|
+
getEntityByModel,
|
|
1444
|
+
createFromDatabase,
|
|
1445
|
+
createAnyFromDatabase,
|
|
1446
|
+
createOneFromDatabase,
|
|
1447
|
+
createOneOrNoneFromDatabase,
|
|
1448
|
+
createManyFromDatabase,
|
|
1449
|
+
// tables property for access to select columns clause string
|
|
1450
|
+
tables: entities.reduce((accum, data) => {
|
|
1451
|
+
accum[data.displayName] = {
|
|
1452
|
+
columns: data.selectColumnsClause
|
|
1453
|
+
};
|
|
1454
|
+
return accum;
|
|
1455
|
+
}, {})
|
|
1456
|
+
};
|
|
1457
|
+
};
|
|
1458
|
+
exports.createOrm = createOrm;
|
|
1459
|
+
const createAbstractionLayer = ({ entities: externalEntities, db, logError }) => {
|
|
1460
|
+
const orm = (0, exports.createOrm)({ entities: externalEntities });
|
|
1461
|
+
const defaultErrorHandler = <span class="fstat-no" title="function not covered" >(e</span>rr) => {
|
|
1462
|
+
<span class="cstat-no" title="statement not covered" > if (!(err.name === 'QueryResultError')) {</span>
|
|
1463
|
+
<span class="cstat-no" title="statement not covered" > if (logError) {</span>
|
|
1464
|
+
<span class="cstat-no" title="statement not covered" > logError(err);</span>
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
<span class="cstat-no" title="statement not covered" > throw err;</span>
|
|
1468
|
+
};
|
|
1469
|
+
/* ------------------------------------------------------------------------*/
|
|
1470
|
+
/* Query functions --------------------------------------------------------*/
|
|
1471
|
+
/* ------------------------------------------------------------------------*/
|
|
1472
|
+
const one = <span class="fstat-no" title="function not covered" >(q</span>uery, values, errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler)</span> => {
|
|
1473
|
+
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
1474
|
+
.many(query, values)
|
|
1475
|
+
.then(<span class="fstat-no" title="function not covered" >(r</span>ows) => <span class="cstat-no" title="statement not covered" >orm.createOneFromDatabase(rows))</span>
|
|
1476
|
+
.catch(errorHandler);
|
|
1477
|
+
};
|
|
1478
|
+
const oneOrNone = <span class="fstat-no" title="function not covered" >(q</span>uery, values, errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler)</span> => {
|
|
1479
|
+
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
1480
|
+
.any(query, values)
|
|
1481
|
+
.then(<span class="fstat-no" title="function not covered" >(r</span>ows) => <span class="cstat-no" title="statement not covered" >orm.createOneOrNoneFromDatabase(rows))</span>
|
|
1482
|
+
.catch(errorHandler);
|
|
1368
1483
|
};
|
|
1484
|
+
const many = <span class="fstat-no" title="function not covered" >(q</span>uery, values, errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler)</span> => {
|
|
1485
|
+
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
1486
|
+
.any(query, values)
|
|
1487
|
+
.then(<span class="fstat-no" title="function not covered" >(r</span>ows) => <span class="cstat-no" title="statement not covered" >orm.createManyFromDatabase(rows))</span>
|
|
1488
|
+
.catch(errorHandler);
|
|
1489
|
+
};
|
|
1490
|
+
const any = <span class="fstat-no" title="function not covered" >(q</span>uery, values, errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler)</span> => {
|
|
1491
|
+
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
1492
|
+
.result(query, values)
|
|
1493
|
+
.then(<span class="fstat-no" title="function not covered" >(r</span>esult) => <span class="cstat-no" title="statement not covered" >orm.createAnyFromDatabase(result.rows, result.fields[0].name.split('#')[0]))</span>
|
|
1494
|
+
.catch(errorHandler);
|
|
1495
|
+
};
|
|
1496
|
+
const none = <span class="fstat-no" title="function not covered" >(q</span>uery, values, errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler)</span> => {
|
|
1497
|
+
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
1498
|
+
.none(query, values)
|
|
1499
|
+
.then(<span class="fstat-no" title="function not covered" >()</span> => <span class="cstat-no" title="statement not covered" >null)</span>
|
|
1500
|
+
.catch(errorHandler);
|
|
1501
|
+
};
|
|
1502
|
+
return Object.assign({}, orm, {
|
|
1503
|
+
// Query Functions
|
|
1504
|
+
one,
|
|
1505
|
+
oneOrNone,
|
|
1506
|
+
many,
|
|
1507
|
+
any,
|
|
1508
|
+
none,
|
|
1509
|
+
// provide direct access to db
|
|
1510
|
+
db
|
|
1511
|
+
});
|
|
1512
|
+
};
|
|
1513
|
+
exports.createAbstractionLayer = createAbstractionLayer;
|
|
1514
|
+
const create = ({ entities: externalEntities, db, logError }) => {
|
|
1515
|
+
const orm = (0, exports.createAbstractionLayer)({
|
|
1516
|
+
entities: externalEntities,
|
|
1517
|
+
db,
|
|
1518
|
+
logError
|
|
1519
|
+
});
|
|
1520
|
+
/* ------------------------------------------------------------------------*/
|
|
1521
|
+
/* Helper Utilities for CRUD functions ------------------------------------*/
|
|
1522
|
+
/* ------------------------------------------------------------------------*/
|
|
1369
1523
|
const getSqlInsertParts = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1370
|
-
const columns = <span class="cstat-no" title="statement not covered" >
|
|
1371
|
-
.
|
|
1524
|
+
const columns = <span class="cstat-no" title="statement not covered" >orm</span>
|
|
1525
|
+
.getEntityByModel(model)
|
|
1526
|
+
.columnNames.filter(<span class="fstat-no" title="function not covered" >(c</span>olumn, index) => <span class="cstat-no" title="statement not covered" >model[orm.getEntityByModel(model).propertyNames[index]] !== void 0)</span>
|
|
1372
1527
|
.map(<span class="fstat-no" title="function not covered" >(c</span>ol) => <span class="cstat-no" title="statement not covered" >`"${col}"`)</span>
|
|
1373
1528
|
.join(', ');
|
|
1374
|
-
const values = <span class="cstat-no" title="statement not covered" >
|
|
1529
|
+
const values = <span class="cstat-no" title="statement not covered" >orm</span>
|
|
1530
|
+
.getEntityByModel(model)
|
|
1375
1531
|
.propertyNames.map(<span class="fstat-no" title="function not covered" >(p</span>roperty) => <span class="cstat-no" title="statement not covered" >model[property])</span>
|
|
1376
1532
|
.filter(<span class="fstat-no" title="function not covered" >(v</span>alue) => <span class="cstat-no" title="statement not covered" >value !== void 0)</span>;
|
|
1377
1533
|
const valuesVar = <span class="cstat-no" title="statement not covered" >values.map(<span class="fstat-no" title="function not covered" >(v</span>alue, index) => <span class="cstat-no" title="statement not covered" >`$${index + 1}`)</span>;</span>
|
|
1378
1534
|
<span class="cstat-no" title="statement not covered" > return { columns, values, valuesVar };</span>
|
|
1379
1535
|
};
|
|
1380
1536
|
const getSqlUpdateParts = <span class="fstat-no" title="function not covered" >(m</span>odel, on = <span class="branch-0 cbranch-no" title="branch not covered" >'id')</span> => {
|
|
1381
|
-
const clauseArray = <span class="cstat-no" title="statement not covered" >
|
|
1382
|
-
.
|
|
1537
|
+
const clauseArray = <span class="cstat-no" title="statement not covered" >orm</span>
|
|
1538
|
+
.getEntityByModel(model)
|
|
1539
|
+
.columnNames.filter(<span class="fstat-no" title="function not covered" >(s</span>qlColumn, index) => <span class="cstat-no" title="statement not covered" >model[orm.getEntityByModel(model).propertyNames[index]] !== void 0)</span>
|
|
1383
1540
|
.map(<span class="fstat-no" title="function not covered" >(s</span>qlColumn, index) => <span class="cstat-no" title="statement not covered" >`"${sqlColumn}" = $${index + 1}`)</span>;
|
|
1384
1541
|
const clause = <span class="cstat-no" title="statement not covered" >clauseArray.join(', ');</span>
|
|
1385
1542
|
const idVar = <span class="cstat-no" title="statement not covered" >`$${clauseArray.length + 1}`;</span>
|
|
1386
|
-
const _values = <span class="cstat-no" title="statement not covered" >
|
|
1543
|
+
const _values = <span class="cstat-no" title="statement not covered" >orm</span>
|
|
1544
|
+
.getEntityByModel(model)
|
|
1387
1545
|
.propertyNames.map(<span class="fstat-no" title="function not covered" >(p</span>roperty) => <span class="cstat-no" title="statement not covered" >model[property])</span>
|
|
1388
1546
|
.filter(<span class="fstat-no" title="function not covered" >(v</span>alue) => <span class="cstat-no" title="statement not covered" >value !== void 0)</span>;
|
|
1389
1547
|
const values = <span class="cstat-no" title="statement not covered" >[..._values, model[on]];</span>
|
|
1390
1548
|
<span class="cstat-no" title="statement not covered" > return { clause, idVar, values };</span>
|
|
1391
1549
|
};
|
|
1392
1550
|
const getMatchingParts = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1393
|
-
const whereClause = <span class="cstat-no" title="statement not covered" >
|
|
1551
|
+
const whereClause = <span class="cstat-no" title="statement not covered" >orm</span>
|
|
1552
|
+
.getEntityByModel(model)
|
|
1394
1553
|
.propertyNames.map(<span class="fstat-no" title="function not covered" >(p</span>roperty, index) => <span class="cstat-no" title="statement not covered" >model[property] != null</span>
|
|
1395
|
-
? `"${getEntityByModel(model).tableName}"."${getEntityByModel(model).columnNames[index]}"`
|
|
1554
|
+
? `"${orm.getEntityByModel(model).tableName}"."${orm.getEntityByModel(model).columnNames[index]}"`
|
|
1396
1555
|
: null)
|
|
1397
1556
|
.filter(<span class="fstat-no" title="function not covered" >(x</span>) => <span class="cstat-no" title="statement not covered" >x != null)</span>
|
|
1398
1557
|
.map(<span class="fstat-no" title="function not covered" >(x</span>, i) => <span class="cstat-no" title="statement not covered" >`${x} = $${i + 1}`)</span>
|
|
1399
1558
|
.join(' AND ');
|
|
1400
|
-
const values = <span class="cstat-no" title="statement not covered" >
|
|
1559
|
+
const values = <span class="cstat-no" title="statement not covered" >orm</span>
|
|
1560
|
+
.getEntityByModel(model)
|
|
1401
1561
|
.propertyNames.map(<span class="fstat-no" title="function not covered" >(p</span>roperty) => <span class="cstat-no" title="statement not covered" >model[property] != null</span>
|
|
1402
1562
|
? model[property]
|
|
1403
1563
|
: null)
|
|
@@ -1407,14 +1567,16 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
1407
1567
|
// This one returns an object, which allows it to be more versatile.
|
|
1408
1568
|
// To-do: make this one even better and use it instead of the one above.
|
|
1409
1569
|
const getMatchingPartsObject = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1410
|
-
const whereClause = <span class="cstat-no" title="statement not covered" >
|
|
1570
|
+
const whereClause = <span class="cstat-no" title="statement not covered" >orm</span>
|
|
1571
|
+
.getEntityByModel(model)
|
|
1411
1572
|
.propertyNames.map(<span class="fstat-no" title="function not covered" >(p</span>roperty, index) => <span class="cstat-no" title="statement not covered" >model[property] != null</span>
|
|
1412
|
-
? `"${getEntityByModel(model).tableName}"."${getEntityByModel(model).columnNames[index]}"`
|
|
1573
|
+
? `"${orm.getEntityByModel(model).tableName}"."${orm.getEntityByModel(model).columnNames[index]}"`
|
|
1413
1574
|
: null)
|
|
1414
1575
|
.filter(<span class="fstat-no" title="function not covered" >(x</span>) => <span class="cstat-no" title="statement not covered" >x != null)</span>
|
|
1415
1576
|
.map(<span class="fstat-no" title="function not covered" >(x</span>, i) => <span class="cstat-no" title="statement not covered" >`${x} = $(${i + 1})`)</span>
|
|
1416
1577
|
.join(' AND ');
|
|
1417
|
-
const values = <span class="cstat-no" title="statement not covered" >
|
|
1578
|
+
const values = <span class="cstat-no" title="statement not covered" >orm</span>
|
|
1579
|
+
.getEntityByModel(model)
|
|
1418
1580
|
.propertyNames.map(<span class="fstat-no" title="function not covered" >(p</span>roperty) => <span class="cstat-no" title="statement not covered" >model[property] != null</span>
|
|
1419
1581
|
? model[property]
|
|
1420
1582
|
: null)
|
|
@@ -1424,7 +1586,7 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
1424
1586
|
};
|
|
1425
1587
|
const getNewWith = <span class="fstat-no" title="function not covered" >(m</span>odel, sqlColumns, values) => {
|
|
1426
1588
|
const Constructor = <span class="cstat-no" title="statement not covered" >model.constructor;</span>
|
|
1427
|
-
const modelKeys = <span class="cstat-no" title="statement not covered" >sqlColumns.map(<span class="fstat-no" title="function not covered" >(k</span>ey) => <span class="cstat-no" title="statement not covered" >getEntityByModel(model).propertyNames[getEntityByModel(model).columnNames.indexOf(key)])</span>;</span>
|
|
1589
|
+
const modelKeys = <span class="cstat-no" title="statement not covered" >sqlColumns.map(<span class="fstat-no" title="function not covered" >(k</span>ey) => <span class="cstat-no" title="statement not covered" >orm.getEntityByModel(model).propertyNames[orm.getEntityByModel(model).columnNames.indexOf(key)])</span>;</span>
|
|
1428
1590
|
const modelData = <span class="cstat-no" title="statement not covered" >modelKeys.reduce(<span class="fstat-no" title="function not covered" >(d</span>ata, key, index) => {</span>
|
|
1429
1591
|
<span class="cstat-no" title="statement not covered" > data[key] = values[index];</span>
|
|
1430
1592
|
<span class="cstat-no" title="statement not covered" > return data;</span>
|
|
@@ -1432,40 +1594,7 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
1432
1594
|
<span class="cstat-no" title="statement not covered" > return new Constructor(modelData);</span>
|
|
1433
1595
|
};
|
|
1434
1596
|
const getValueBySqlColumn = <span class="fstat-no" title="function not covered" >(m</span>odel, sqlColumn) => {
|
|
1435
|
-
<span class="cstat-no" title="statement not covered" > return model[getEntityByModel(model).propertyNames[getEntityByModel(model).columnNames.indexOf(sqlColumn)]];</span>
|
|
1436
|
-
};
|
|
1437
|
-
/* ------------------------------------------------------------------------*/
|
|
1438
|
-
/* Query functions --------------------------------------------------------*/
|
|
1439
|
-
/* ------------------------------------------------------------------------*/
|
|
1440
|
-
const one = <span class="fstat-no" title="function not covered" >(q</span>uery, values, errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler)</span> => {
|
|
1441
|
-
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
1442
|
-
.many(query, values)
|
|
1443
|
-
.then(<span class="fstat-no" title="function not covered" >(r</span>ows) => <span class="cstat-no" title="statement not covered" >createOneFromDatabase(rows))</span>
|
|
1444
|
-
.catch(errorHandler);
|
|
1445
|
-
};
|
|
1446
|
-
const oneOrNone = <span class="fstat-no" title="function not covered" >(q</span>uery, values, errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler)</span> => {
|
|
1447
|
-
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
1448
|
-
.any(query, values)
|
|
1449
|
-
.then(<span class="fstat-no" title="function not covered" >(r</span>ows) => <span class="cstat-no" title="statement not covered" >createOneOrNoneFromDatabase(rows))</span>
|
|
1450
|
-
.catch(errorHandler);
|
|
1451
|
-
};
|
|
1452
|
-
const many = <span class="fstat-no" title="function not covered" >(q</span>uery, values, errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler)</span> => {
|
|
1453
|
-
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
1454
|
-
.any(query, values)
|
|
1455
|
-
.then(<span class="fstat-no" title="function not covered" >(r</span>ows) => <span class="cstat-no" title="statement not covered" >createManyFromDatabase(rows))</span>
|
|
1456
|
-
.catch(errorHandler);
|
|
1457
|
-
};
|
|
1458
|
-
const any = <span class="fstat-no" title="function not covered" >(q</span>uery, values, errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler)</span> => {
|
|
1459
|
-
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
1460
|
-
.any(query, values)
|
|
1461
|
-
.then(<span class="fstat-no" title="function not covered" >(r</span>ows) => <span class="cstat-no" title="statement not covered" >createFromDatabase(rows))</span>
|
|
1462
|
-
.catch(errorHandler);
|
|
1463
|
-
};
|
|
1464
|
-
const none = <span class="fstat-no" title="function not covered" >(q</span>uery, values, errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler)</span> => {
|
|
1465
|
-
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
1466
|
-
.none(query, values)
|
|
1467
|
-
.then(<span class="fstat-no" title="function not covered" >()</span> => <span class="cstat-no" title="statement not covered" >null)</span>
|
|
1468
|
-
.catch(errorHandler);
|
|
1597
|
+
<span class="cstat-no" title="statement not covered" > return model[orm.getEntityByModel(model).propertyNames[orm.getEntityByModel(model).columnNames.indexOf(sqlColumn)]];</span>
|
|
1469
1598
|
};
|
|
1470
1599
|
/* ------------------------------------------------------------------------*/
|
|
1471
1600
|
/* Built-in basic CRUD functions ------------------------------------------*/
|
|
@@ -1474,98 +1603,77 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
1474
1603
|
const create = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1475
1604
|
const { columns, values, valuesVar } = <span class="cstat-no" title="statement not covered" >getSqlInsertParts(model);</span>
|
|
1476
1605
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
1477
|
-
INSERT INTO "${getEntityByModel(model).tableName}" ( ${columns} )
|
|
1606
|
+
INSERT INTO "${orm.getEntityByModel(model).tableName}" ( ${columns} )
|
|
1478
1607
|
VALUES ( ${valuesVar} )
|
|
1479
|
-
RETURNING ${getEntityByModel(model).selectColumnsClause};
|
|
1608
|
+
RETURNING ${orm.getEntityByModel(model).selectColumnsClause};
|
|
1480
1609
|
`;
|
|
1481
|
-
<span class="cstat-no" title="statement not covered" > return one(query, values);</span>
|
|
1610
|
+
<span class="cstat-no" title="statement not covered" > return orm.one(query, values);</span>
|
|
1482
1611
|
};
|
|
1483
1612
|
// Standard update
|
|
1484
1613
|
const update = <span class="fstat-no" title="function not covered" >(m</span>odel, { on = <span class="branch-0 cbranch-no" title="branch not covered" >'id' </span>} = <span class="branch-0 cbranch-no" title="branch not covered" >{})</span> => {
|
|
1485
1614
|
const { clause, idVar, values } = <span class="cstat-no" title="statement not covered" >getSqlUpdateParts(model, on);</span>
|
|
1486
1615
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
1487
|
-
UPDATE "${getEntityByModel(model).tableName}"
|
|
1616
|
+
UPDATE "${orm.getEntityByModel(model).tableName}"
|
|
1488
1617
|
SET ${clause}
|
|
1489
|
-
WHERE "${getEntityByModel(model).tableName}".${on} = ${idVar}
|
|
1490
|
-
RETURNING ${getEntityByModel(model).selectColumnsClause};
|
|
1618
|
+
WHERE "${orm.getEntityByModel(model).tableName}".${on} = ${idVar}
|
|
1619
|
+
RETURNING ${orm.getEntityByModel(model).selectColumnsClause};
|
|
1491
1620
|
`;
|
|
1492
|
-
<span class="cstat-no" title="statement not covered" > return one(query, values);</span>
|
|
1621
|
+
<span class="cstat-no" title="statement not covered" > return orm.one(query, values);</span>
|
|
1493
1622
|
};
|
|
1494
1623
|
// Standard delete
|
|
1495
1624
|
const _delete = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1496
1625
|
const id = <span class="cstat-no" title="statement not covered" >model.id;</span>
|
|
1497
1626
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
1498
|
-
DELETE FROM "${getEntityByModel(model).tableName}"
|
|
1499
|
-
WHERE "${getEntityByModel(model).tableName}".id = $(id)
|
|
1627
|
+
DELETE FROM "${orm.getEntityByModel(model).tableName}"
|
|
1628
|
+
WHERE "${orm.getEntityByModel(model).tableName}".id = $(id)
|
|
1500
1629
|
`;
|
|
1501
|
-
<span class="cstat-no" title="statement not covered" > return none(query, { id });</span>
|
|
1630
|
+
<span class="cstat-no" title="statement not covered" > return orm.none(query, { id });</span>
|
|
1502
1631
|
};
|
|
1503
1632
|
const deleteMatching = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1504
1633
|
const { whereClause, values } = <span class="cstat-no" title="statement not covered" >getMatchingParts(model);</span>
|
|
1505
1634
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
1506
|
-
DELETE FROM "${getEntityByModel(model).tableName}"
|
|
1635
|
+
DELETE FROM "${orm.getEntityByModel(model).tableName}"
|
|
1507
1636
|
WHERE ${whereClause};
|
|
1508
1637
|
`;
|
|
1509
|
-
<span class="cstat-no" title="statement not covered" > return none(query, values);</span>
|
|
1638
|
+
<span class="cstat-no" title="statement not covered" > return orm.none(query, values);</span>
|
|
1510
1639
|
};
|
|
1511
1640
|
const getMatching = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1512
1641
|
const { whereClause, values } = <span class="cstat-no" title="statement not covered" >getMatchingParts(model);</span>
|
|
1513
1642
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
1514
|
-
SELECT ${getEntityByModel(model).selectColumnsClause}
|
|
1515
|
-
FROM "${getEntityByModel(model).tableName}"
|
|
1643
|
+
SELECT ${orm.getEntityByModel(model).selectColumnsClause}
|
|
1644
|
+
FROM "${orm.getEntityByModel(model).tableName}"
|
|
1516
1645
|
WHERE ${whereClause};
|
|
1517
1646
|
`;
|
|
1518
|
-
<span class="cstat-no" title="statement not covered" > return one(query, values);</span>
|
|
1647
|
+
<span class="cstat-no" title="statement not covered" > return orm.one(query, values);</span>
|
|
1519
1648
|
};
|
|
1520
1649
|
const getOneOrNoneMatching = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1521
1650
|
const { whereClause, values } = <span class="cstat-no" title="statement not covered" >getMatchingParts(model);</span>
|
|
1522
1651
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
1523
|
-
SELECT ${getEntityByModel(model).selectColumnsClause}
|
|
1524
|
-
FROM "${getEntityByModel(model).tableName}"
|
|
1652
|
+
SELECT ${orm.getEntityByModel(model).selectColumnsClause}
|
|
1653
|
+
FROM "${orm.getEntityByModel(model).tableName}"
|
|
1525
1654
|
WHERE ${whereClause};
|
|
1526
1655
|
`;
|
|
1527
|
-
<span class="cstat-no" title="statement not covered" > return oneOrNone(query, values);</span>
|
|
1656
|
+
<span class="cstat-no" title="statement not covered" > return orm.oneOrNone(query, values);</span>
|
|
1528
1657
|
};
|
|
1529
1658
|
const getAnyMatching = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1530
1659
|
const { whereClause, values } = <span class="cstat-no" title="statement not covered" >getMatchingParts(model);</span>
|
|
1531
1660
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
1532
|
-
SELECT ${getEntityByModel(model).selectColumnsClause}
|
|
1533
|
-
FROM "${getEntityByModel(model).tableName}"
|
|
1661
|
+
SELECT ${orm.getEntityByModel(model).selectColumnsClause}
|
|
1662
|
+
FROM "${orm.getEntityByModel(model).tableName}"
|
|
1534
1663
|
WHERE ${whereClause};
|
|
1535
1664
|
`;
|
|
1536
|
-
<span class="cstat-no" title="statement not covered" > return any(query, values);</span>
|
|
1665
|
+
<span class="cstat-no" title="statement not covered" > return orm.any(query, values);</span>
|
|
1537
1666
|
};
|
|
1538
1667
|
const getAllMatching = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1539
1668
|
const { whereClause, values } = <span class="cstat-no" title="statement not covered" >getMatchingParts(model);</span>
|
|
1540
1669
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
1541
|
-
SELECT ${getEntityByModel(model).selectColumnsClause}
|
|
1542
|
-
FROM "${getEntityByModel(model).tableName}"
|
|
1670
|
+
SELECT ${orm.getEntityByModel(model).selectColumnsClause}
|
|
1671
|
+
FROM "${orm.getEntityByModel(model).tableName}"
|
|
1543
1672
|
WHERE ${whereClause};
|
|
1544
1673
|
`;
|
|
1545
|
-
<span class="cstat-no" title="statement not covered" > return many(query, values);</span>
|
|
1674
|
+
<span class="cstat-no" title="statement not covered" > return orm.many(query, values);</span>
|
|
1546
1675
|
};
|
|
1547
|
-
return {
|
|
1548
|
-
// Query Helper Function
|
|
1549
|
-
nestClump,
|
|
1550
|
-
clumpIntoGroups,
|
|
1551
|
-
mapToBos,
|
|
1552
|
-
objectifyDatabaseResult,
|
|
1553
|
-
createFromDatabase,
|
|
1554
|
-
createOneFromDatabase,
|
|
1555
|
-
createOneOrNoneFromDatabase,
|
|
1556
|
-
createManyFromDatabase,
|
|
1557
|
-
getSqlInsertParts,
|
|
1558
|
-
getSqlUpdateParts,
|
|
1559
|
-
getMatchingParts,
|
|
1560
|
-
getMatchingPartsObject,
|
|
1561
|
-
getNewWith,
|
|
1562
|
-
getValueBySqlColumn,
|
|
1563
|
-
// Query Functions
|
|
1564
|
-
one,
|
|
1565
|
-
oneOrNone,
|
|
1566
|
-
many,
|
|
1567
|
-
any,
|
|
1568
|
-
none,
|
|
1676
|
+
return Object.assign({}, orm, {
|
|
1569
1677
|
// Built-in basic CRUD functions
|
|
1570
1678
|
create,
|
|
1571
1679
|
update,
|
|
@@ -1575,11 +1683,14 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
1575
1683
|
getOneOrNoneMatching,
|
|
1576
1684
|
getAnyMatching,
|
|
1577
1685
|
getAllMatching,
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1686
|
+
// Helper Utility functions
|
|
1687
|
+
getSqlInsertParts,
|
|
1688
|
+
getSqlUpdateParts,
|
|
1689
|
+
getMatchingParts,
|
|
1690
|
+
getMatchingPartsObject,
|
|
1691
|
+
getNewWith,
|
|
1692
|
+
getValueBySqlColumn
|
|
1693
|
+
});
|
|
1583
1694
|
};
|
|
1584
1695
|
exports.create = create;
|
|
1585
1696
|
</pre></td></tr>
|
|
@@ -1588,7 +1699,7 @@ exports.create = create;
|
|
|
1588
1699
|
</div><!-- /wrapper -->
|
|
1589
1700
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1590
1701
|
Code coverage
|
|
1591
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
1702
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Sat May 07 2022 10:17:08 GMT-0400 (Eastern Daylight Time)
|
|
1592
1703
|
</div>
|
|
1593
1704
|
</div>
|
|
1594
1705
|
<script src="../../prettify.js"></script>
|