pure-orm 4.0.0-5 → 4.0.0-8
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 +14 -20
- package/coverage/clover.xml +375 -577
- package/coverage/coverage-final.json +18 -20
- package/coverage/lcov-report/dist/src/core.js.html +1038 -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 +293 -197
- 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 +1593 -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 +436 -250
- 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 +726 -1143
- package/dist/example/factories/orm.d.ts +1 -47
- 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} +51 -245
- 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} +102 -338
- 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 -100
- package/dist/test-utils/blog/orm.d.ts +0 -2
- package/dist/test-utils/five/orm.d.ts +0 -48
- package/dist/test-utils/nine/orm.d.ts +0 -48
- 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 -48
- package/dist/test-utils/order-more/orm.d.ts +0 -48
- package/dist/test-utils/six/orm.d.ts +0 -48
- package/dist/test-utils/thirteen/orm.d.ts +0 -48
- package/dist/test-utils/twelve/orm.d.ts +0 -48
- 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">
|
|
@@ -563,7 +563,39 @@
|
|
|
563
563
|
<a name='L515'></a><a href='#L515'>515</a>
|
|
564
564
|
<a name='L516'></a><a href='#L516'>516</a>
|
|
565
565
|
<a name='L517'></a><a href='#L517'>517</a>
|
|
566
|
-
<a name='L518'></a><a href='#L518'>518</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>
|
|
567
599
|
<span class="cline-any cline-yes">1x</span>
|
|
568
600
|
<span class="cline-any cline-yes">1x</span>
|
|
569
601
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -634,14 +666,6 @@
|
|
|
634
666
|
<span class="cline-any cline-neutral"> </span>
|
|
635
667
|
<span class="cline-any cline-yes">38207x</span>
|
|
636
668
|
<span class="cline-any cline-neutral"> </span>
|
|
637
|
-
<span class="cline-any cline-yes">8x</span>
|
|
638
|
-
<span class="cline-any cline-no"> </span>
|
|
639
|
-
<span class="cline-any cline-no"> </span>
|
|
640
|
-
<span class="cline-any cline-no"> </span>
|
|
641
|
-
<span class="cline-any cline-neutral"> </span>
|
|
642
|
-
<span class="cline-any cline-neutral"> </span>
|
|
643
|
-
<span class="cline-any cline-no"> </span>
|
|
644
|
-
<span class="cline-any cline-neutral"> </span>
|
|
645
669
|
<span class="cline-any cline-neutral"> </span>
|
|
646
670
|
<span class="cline-any cline-neutral"> </span>
|
|
647
671
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -815,6 +839,9 @@
|
|
|
815
839
|
<span class="cline-any cline-yes">3703x</span>
|
|
816
840
|
<span class="cline-any cline-yes">3703x</span>
|
|
817
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>
|
|
818
845
|
<span class="cline-any cline-yes">3703x</span>
|
|
819
846
|
<span class="cline-any cline-yes">3703x</span>
|
|
820
847
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -830,11 +857,20 @@
|
|
|
830
857
|
<span class="cline-any cline-yes">13x</span>
|
|
831
858
|
<span class="cline-any cline-neutral"> </span>
|
|
832
859
|
<span class="cline-any cline-yes">8x</span>
|
|
833
|
-
<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>
|
|
834
869
|
<span class="cline-any cline-yes">4x</span>
|
|
835
870
|
<span class="cline-any cline-no"> </span>
|
|
836
871
|
<span class="cline-any cline-neutral"> </span>
|
|
837
872
|
<span class="cline-any cline-yes">4x</span>
|
|
873
|
+
<span class="cline-any cline-yes">4x</span>
|
|
838
874
|
<span class="cline-any cline-no"> </span>
|
|
839
875
|
<span class="cline-any cline-neutral"> </span>
|
|
840
876
|
<span class="cline-any cline-yes">4x</span>
|
|
@@ -847,118 +883,169 @@
|
|
|
847
883
|
<span class="cline-any cline-no"> </span>
|
|
848
884
|
<span class="cline-any cline-neutral"> </span>
|
|
849
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>
|
|
850
888
|
<span class="cline-any cline-no"> </span>
|
|
851
889
|
<span class="cline-any cline-no"> </span>
|
|
852
890
|
<span class="cline-any cline-neutral"> </span>
|
|
853
891
|
<span class="cline-any cline-no"> </span>
|
|
854
892
|
<span class="cline-any cline-neutral"> </span>
|
|
855
893
|
<span class="cline-any cline-yes">8x</span>
|
|
856
|
-
<span class="cline-any cline-no"> </span>
|
|
857
|
-
<span class="cline-any cline-no"> </span>
|
|
858
|
-
<span class="cline-any cline-no"> </span>
|
|
859
894
|
<span class="cline-any cline-neutral"> </span>
|
|
860
|
-
<span class="cline-any cline-no"> </span>
|
|
861
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>
|
|
862
912
|
<span class="cline-any cline-yes">8x</span>
|
|
863
913
|
<span class="cline-any cline-no"> </span>
|
|
864
914
|
<span class="cline-any cline-no"> </span>
|
|
865
915
|
<span class="cline-any cline-no"> </span>
|
|
866
916
|
<span class="cline-any cline-neutral"> </span>
|
|
867
|
-
<span class="cline-any cline-
|
|
868
|
-
<span class="cline-any cline-no"> </span>
|
|
869
|
-
<span class="cline-any cline-no"> </span>
|
|
870
|
-
<span class="cline-any cline-no"> </span>
|
|
917
|
+
<span class="cline-any cline-neutral"> </span>
|
|
871
918
|
<span class="cline-any cline-no"> </span>
|
|
872
919
|
<span class="cline-any cline-neutral"> </span>
|
|
920
|
+
<span class="cline-any cline-neutral"> </span>
|
|
921
|
+
<span class="cline-any cline-neutral"> </span>
|
|
922
|
+
<span class="cline-any cline-neutral"> </span>
|
|
873
923
|
<span class="cline-any cline-yes">8x</span>
|
|
874
924
|
<span class="cline-any cline-no"> </span>
|
|
925
|
+
<span class="cline-any cline-neutral"> </span>
|
|
875
926
|
<span class="cline-any cline-no"> </span>
|
|
876
|
-
<span class="cline-any cline-
|
|
877
|
-
<span class="cline-any cline-no"> </span>
|
|
878
|
-
<span class="cline-any cline-no"> </span>
|
|
879
|
-
<span class="cline-any cline-no"> </span>
|
|
880
|
-
<span class="cline-any cline-no"> </span>
|
|
881
|
-
<span class="cline-any cline-no"> </span>
|
|
882
|
-
<span class="cline-any cline-no"> </span>
|
|
883
|
-
<span class="cline-any cline-no"> </span>
|
|
927
|
+
<span class="cline-any cline-neutral"> </span>
|
|
884
928
|
<span class="cline-any cline-neutral"> </span>
|
|
885
929
|
<span class="cline-any cline-yes">8x</span>
|
|
886
930
|
<span class="cline-any cline-no"> </span>
|
|
931
|
+
<span class="cline-any cline-neutral"> </span>
|
|
887
932
|
<span class="cline-any cline-no"> </span>
|
|
888
933
|
<span class="cline-any cline-neutral"> </span>
|
|
889
934
|
<span class="cline-any cline-neutral"> </span>
|
|
935
|
+
<span class="cline-any cline-yes">8x</span>
|
|
890
936
|
<span class="cline-any cline-no"> </span>
|
|
937
|
+
<span class="cline-any cline-neutral"> </span>
|
|
891
938
|
<span class="cline-any cline-no"> </span>
|
|
892
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>
|
|
893
942
|
<span class="cline-any cline-no"> </span>
|
|
943
|
+
<span class="cline-any cline-neutral"> </span>
|
|
894
944
|
<span class="cline-any cline-no"> </span>
|
|
895
945
|
<span class="cline-any cline-neutral"> </span>
|
|
896
946
|
<span class="cline-any cline-neutral"> </span>
|
|
947
|
+
<span class="cline-any cline-yes">8x</span>
|
|
897
948
|
<span class="cline-any cline-no"> </span>
|
|
949
|
+
<span class="cline-any cline-neutral"> </span>
|
|
898
950
|
<span class="cline-any cline-no"> </span>
|
|
899
951
|
<span class="cline-any cline-neutral"> </span>
|
|
900
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>
|
|
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>
|
|
901
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>
|
|
902
966
|
<span class="cline-any cline-yes">8x</span>
|
|
903
|
-
<span class="cline-any cline-no"> </span>
|
|
904
|
-
<span class="cline-any cline-no"> </span>
|
|
905
967
|
<span class="cline-any cline-neutral"> </span>
|
|
906
968
|
<span class="cline-any cline-neutral"> </span>
|
|
907
|
-
<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>
|
|
908
975
|
<span class="cline-any cline-no"> </span>
|
|
909
976
|
<span class="cline-any cline-neutral"> </span>
|
|
910
977
|
<span class="cline-any cline-no"> </span>
|
|
911
978
|
<span class="cline-any cline-no"> </span>
|
|
912
979
|
<span class="cline-any cline-neutral"> </span>
|
|
980
|
+
<span class="cline-any cline-no"> </span>
|
|
913
981
|
<span class="cline-any cline-neutral"> </span>
|
|
914
982
|
<span class="cline-any cline-no"> </span>
|
|
915
983
|
<span class="cline-any cline-no"> </span>
|
|
916
984
|
<span class="cline-any cline-no"> </span>
|
|
985
|
+
<span class="cline-any cline-no"> </span>
|
|
917
986
|
<span class="cline-any cline-neutral"> </span>
|
|
918
987
|
<span class="cline-any cline-yes">8x</span>
|
|
919
988
|
<span class="cline-any cline-no"> </span>
|
|
989
|
+
<span class="cline-any cline-neutral"> </span>
|
|
990
|
+
<span class="cline-any cline-no"> </span>
|
|
920
991
|
<span class="cline-any cline-no"> </span>
|
|
921
992
|
<span class="cline-any cline-no"> </span>
|
|
922
993
|
<span class="cline-any cline-no"> </span>
|
|
923
994
|
<span class="cline-any cline-no"> </span>
|
|
924
995
|
<span class="cline-any cline-neutral"> </span>
|
|
925
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>
|
|
926
1000
|
<span class="cline-any cline-neutral"> </span>
|
|
927
1001
|
<span class="cline-any cline-yes">8x</span>
|
|
928
1002
|
<span class="cline-any cline-no"> </span>
|
|
929
1003
|
<span class="cline-any cline-neutral"> </span>
|
|
1004
|
+
<span class="cline-any cline-no"> </span>
|
|
930
1005
|
<span class="cline-any cline-neutral"> </span>
|
|
931
1006
|
<span class="cline-any cline-neutral"> </span>
|
|
1007
|
+
<span class="cline-any cline-no"> </span>
|
|
1008
|
+
<span class="cline-any cline-no"> </span>
|
|
932
1009
|
<span class="cline-any cline-neutral"> </span>
|
|
933
|
-
<span class="cline-any cline-yes">8x</span>
|
|
934
1010
|
<span class="cline-any cline-no"> </span>
|
|
935
1011
|
<span class="cline-any cline-neutral"> </span>
|
|
936
1012
|
<span class="cline-any cline-no"> </span>
|
|
937
1013
|
<span class="cline-any cline-neutral"> </span>
|
|
938
1014
|
<span class="cline-any cline-neutral"> </span>
|
|
939
|
-
<span class="cline-any cline-yes">8x</span>
|
|
940
1015
|
<span class="cline-any cline-no"> </span>
|
|
941
|
-
<span class="cline-any cline-neutral"> </span>
|
|
942
1016
|
<span class="cline-any cline-no"> </span>
|
|
943
1017
|
<span class="cline-any cline-neutral"> </span>
|
|
944
1018
|
<span class="cline-any cline-neutral"> </span>
|
|
1019
|
+
<span class="cline-any cline-neutral"> </span>
|
|
945
1020
|
<span class="cline-any cline-yes">8x</span>
|
|
946
1021
|
<span class="cline-any cline-no"> </span>
|
|
947
1022
|
<span class="cline-any cline-neutral"> </span>
|
|
948
1023
|
<span class="cline-any cline-no"> </span>
|
|
949
1024
|
<span class="cline-any cline-neutral"> </span>
|
|
950
1025
|
<span class="cline-any cline-neutral"> </span>
|
|
951
|
-
<span class="cline-any cline-
|
|
1026
|
+
<span class="cline-any cline-no"> </span>
|
|
952
1027
|
<span class="cline-any cline-no"> </span>
|
|
953
1028
|
<span class="cline-any cline-neutral"> </span>
|
|
954
1029
|
<span class="cline-any cline-no"> </span>
|
|
955
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>
|
|
956
1037
|
<span class="cline-any cline-neutral"> </span>
|
|
957
1038
|
<span class="cline-any cline-yes">8x</span>
|
|
958
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>
|
|
959
1044
|
<span class="cline-any cline-neutral"> </span>
|
|
960
1045
|
<span class="cline-any cline-no"> </span>
|
|
961
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>
|
|
962
1049
|
<span class="cline-any cline-neutral"> </span>
|
|
963
1050
|
<span class="cline-any cline-neutral"> </span>
|
|
964
1051
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1056,35 +1143,12 @@
|
|
|
1056
1143
|
<span class="cline-any cline-neutral"> </span>
|
|
1057
1144
|
<span class="cline-any cline-neutral"> </span>
|
|
1058
1145
|
<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-neutral"> </span>
|
|
1068
|
-
<span class="cline-any cline-neutral"> </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
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1073
|
-
<span class="cline-any cline-yes">50x</span>
|
|
1074
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1075
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1076
|
-
<span class="cline-any cline-yes">50x</span>
|
|
1077
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1078
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1079
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1080
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1081
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1082
1146
|
<span class="cline-any cline-yes">1x</span>
|
|
1083
1147
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">"use strict";
|
|
1084
1148
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1085
|
-
exports.create = void 0;
|
|
1149
|
+
exports.create = exports.createAbstractionLayer = exports.createOrm = void 0;
|
|
1086
1150
|
const camelCase = require('camelcase');
|
|
1087
|
-
const
|
|
1151
|
+
const createOrm = ({ entities: externalEntities }) => {
|
|
1088
1152
|
const entities = externalEntities.map((d) => {
|
|
1089
1153
|
const tableName = d.tableName;
|
|
1090
1154
|
const displayName = d.displayName || camelCase(d.tableName);
|
|
@@ -1151,14 +1215,6 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
1151
1215
|
}
|
|
1152
1216
|
return entity;
|
|
1153
1217
|
};
|
|
1154
|
-
const defaultErrorHandler = <span class="fstat-no" title="function not covered" >(e</span>rr) => {
|
|
1155
|
-
<span class="cstat-no" title="statement not covered" > if (!(err.name === 'QueryResultError')) {</span>
|
|
1156
|
-
<span class="cstat-no" title="statement not covered" > if (logError) {</span>
|
|
1157
|
-
<span class="cstat-no" title="statement not covered" > logError(err);</span>
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
<span class="cstat-no" title="statement not covered" > throw err;</span>
|
|
1161
|
-
};
|
|
1162
1218
|
/*
|
|
1163
1219
|
* In:
|
|
1164
1220
|
* [
|
|
@@ -1331,27 +1387,39 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
1331
1387
|
return Object.keys(result).reduce((obj, text) => {
|
|
1332
1388
|
const tableName = text.split('#')[0];
|
|
1333
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
|
+
}
|
|
1334
1393
|
obj[tableName] = obj[tableName] || {};
|
|
1335
1394
|
obj[tableName][column] = result[text];
|
|
1336
1395
|
return obj;
|
|
1337
1396
|
}, {});
|
|
1338
1397
|
};
|
|
1339
|
-
const createFromDatabase = (
|
|
1340
|
-
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>
|
|
1341
1400
|
const objectified = result.map(objectifyDatabaseResult);
|
|
1342
1401
|
const boified = objectified.map(mapToBos);
|
|
1343
1402
|
const clumps = clumpIntoGroups(boified);
|
|
1344
1403
|
const nested = clumps.map(nestClump);
|
|
1345
1404
|
const models = nested.map((n) => Object.values(n)[0]);
|
|
1346
1405
|
const Collection = getEntityByModel(models[0]).Collection;
|
|
1347
|
-
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>
|
|
1348
1416
|
};
|
|
1349
|
-
const createOneFromDatabase = (
|
|
1350
|
-
|
|
1351
|
-
<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) {
|
|
1352
1419
|
<span class="cstat-no" title="statement not covered" > throw Error('Did not get one.');</span>
|
|
1353
1420
|
}
|
|
1354
|
-
|
|
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) {
|
|
1355
1423
|
<span class="cstat-no" title="statement not covered" > throw Error('Did not get one.');</span>
|
|
1356
1424
|
}
|
|
1357
1425
|
else <span class="missing-if-branch" title="if path not taken" >I</span>if (collection.models.length > 1) {
|
|
@@ -1359,55 +1427,137 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
1359
1427
|
}
|
|
1360
1428
|
return collection.models[0];
|
|
1361
1429
|
};
|
|
1362
|
-
const createOneOrNoneFromDatabase = <span class="fstat-no" title="function not covered" >(
|
|
1363
|
-
<span class="cstat-no" title="statement not covered" > if (!
|
|
1364
|
-
<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>
|
|
1365
1433
|
}
|
|
1366
|
-
|
|
1367
|
-
<span class="cstat-no" title="statement not covered" > if (collection && collection.models.length > 1) {</span>
|
|
1368
|
-
<span class="cstat-no" title="statement not covered" > throw Error('Got more than one.');</span>
|
|
1369
|
-
}
|
|
1370
|
-
<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>
|
|
1371
1435
|
};
|
|
1372
|
-
const createManyFromDatabase = <span class="fstat-no" title="function not covered" >(
|
|
1373
|
-
|
|
1374
|
-
<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>
|
|
1375
1438
|
<span class="cstat-no" title="statement not covered" > throw Error('Did not get at least one.');</span>
|
|
1376
1439
|
}
|
|
1377
|
-
<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);
|
|
1378
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);
|
|
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
|
+
/* ------------------------------------------------------------------------*/
|
|
1379
1523
|
const getSqlInsertParts = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1380
|
-
const columns = <span class="cstat-no" title="statement not covered" >
|
|
1381
|
-
.
|
|
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>
|
|
1382
1527
|
.map(<span class="fstat-no" title="function not covered" >(c</span>ol) => <span class="cstat-no" title="statement not covered" >`"${col}"`)</span>
|
|
1383
1528
|
.join(', ');
|
|
1384
|
-
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)
|
|
1385
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>
|
|
1386
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>;
|
|
1387
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>
|
|
1388
1534
|
<span class="cstat-no" title="statement not covered" > return { columns, values, valuesVar };</span>
|
|
1389
1535
|
};
|
|
1390
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> => {
|
|
1391
|
-
const clauseArray = <span class="cstat-no" title="statement not covered" >
|
|
1392
|
-
.
|
|
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>
|
|
1393
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>;
|
|
1394
1541
|
const clause = <span class="cstat-no" title="statement not covered" >clauseArray.join(', ');</span>
|
|
1395
1542
|
const idVar = <span class="cstat-no" title="statement not covered" >`$${clauseArray.length + 1}`;</span>
|
|
1396
|
-
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)
|
|
1397
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>
|
|
1398
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>;
|
|
1399
1547
|
const values = <span class="cstat-no" title="statement not covered" >[..._values, model[on]];</span>
|
|
1400
1548
|
<span class="cstat-no" title="statement not covered" > return { clause, idVar, values };</span>
|
|
1401
1549
|
};
|
|
1402
1550
|
const getMatchingParts = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1403
|
-
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)
|
|
1404
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>
|
|
1405
|
-
? `"${getEntityByModel(model).tableName}"."${getEntityByModel(model).columnNames[index]}"`
|
|
1554
|
+
? `"${orm.getEntityByModel(model).tableName}"."${orm.getEntityByModel(model).columnNames[index]}"`
|
|
1406
1555
|
: null)
|
|
1407
1556
|
.filter(<span class="fstat-no" title="function not covered" >(x</span>) => <span class="cstat-no" title="statement not covered" >x != null)</span>
|
|
1408
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>
|
|
1409
1558
|
.join(' AND ');
|
|
1410
|
-
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)
|
|
1411
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>
|
|
1412
1562
|
? model[property]
|
|
1413
1563
|
: null)
|
|
@@ -1417,14 +1567,16 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
1417
1567
|
// This one returns an object, which allows it to be more versatile.
|
|
1418
1568
|
// To-do: make this one even better and use it instead of the one above.
|
|
1419
1569
|
const getMatchingPartsObject = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1420
|
-
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)
|
|
1421
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>
|
|
1422
|
-
? `"${getEntityByModel(model).tableName}"."${getEntityByModel(model).columnNames[index]}"`
|
|
1573
|
+
? `"${orm.getEntityByModel(model).tableName}"."${orm.getEntityByModel(model).columnNames[index]}"`
|
|
1423
1574
|
: null)
|
|
1424
1575
|
.filter(<span class="fstat-no" title="function not covered" >(x</span>) => <span class="cstat-no" title="statement not covered" >x != null)</span>
|
|
1425
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>
|
|
1426
1577
|
.join(' AND ');
|
|
1427
|
-
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)
|
|
1428
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>
|
|
1429
1581
|
? model[property]
|
|
1430
1582
|
: null)
|
|
@@ -1434,7 +1586,7 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
1434
1586
|
};
|
|
1435
1587
|
const getNewWith = <span class="fstat-no" title="function not covered" >(m</span>odel, sqlColumns, values) => {
|
|
1436
1588
|
const Constructor = <span class="cstat-no" title="statement not covered" >model.constructor;</span>
|
|
1437
|
-
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>
|
|
1438
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>
|
|
1439
1591
|
<span class="cstat-no" title="statement not covered" > data[key] = values[index];</span>
|
|
1440
1592
|
<span class="cstat-no" title="statement not covered" > return data;</span>
|
|
@@ -1442,40 +1594,7 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
1442
1594
|
<span class="cstat-no" title="statement not covered" > return new Constructor(modelData);</span>
|
|
1443
1595
|
};
|
|
1444
1596
|
const getValueBySqlColumn = <span class="fstat-no" title="function not covered" >(m</span>odel, sqlColumn) => {
|
|
1445
|
-
<span class="cstat-no" title="statement not covered" > return model[getEntityByModel(model).propertyNames[getEntityByModel(model).columnNames.indexOf(sqlColumn)]];</span>
|
|
1446
|
-
};
|
|
1447
|
-
/* ------------------------------------------------------------------------*/
|
|
1448
|
-
/* Query functions --------------------------------------------------------*/
|
|
1449
|
-
/* ------------------------------------------------------------------------*/
|
|
1450
|
-
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> => {
|
|
1451
|
-
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
1452
|
-
.many(query, values)
|
|
1453
|
-
.then(<span class="fstat-no" title="function not covered" >(r</span>ows) => <span class="cstat-no" title="statement not covered" >createOneFromDatabase(rows))</span>
|
|
1454
|
-
.catch(errorHandler);
|
|
1455
|
-
};
|
|
1456
|
-
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> => {
|
|
1457
|
-
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
1458
|
-
.any(query, values)
|
|
1459
|
-
.then(<span class="fstat-no" title="function not covered" >(r</span>ows) => <span class="cstat-no" title="statement not covered" >createOneOrNoneFromDatabase(rows))</span>
|
|
1460
|
-
.catch(errorHandler);
|
|
1461
|
-
};
|
|
1462
|
-
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> => {
|
|
1463
|
-
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
1464
|
-
.any(query, values)
|
|
1465
|
-
.then(<span class="fstat-no" title="function not covered" >(r</span>ows) => <span class="cstat-no" title="statement not covered" >createManyFromDatabase(rows))</span>
|
|
1466
|
-
.catch(errorHandler);
|
|
1467
|
-
};
|
|
1468
|
-
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> => {
|
|
1469
|
-
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
1470
|
-
.any(query, values)
|
|
1471
|
-
.then(<span class="fstat-no" title="function not covered" >(r</span>ows) => <span class="cstat-no" title="statement not covered" >createFromDatabase(rows))</span>
|
|
1472
|
-
.catch(errorHandler);
|
|
1473
|
-
};
|
|
1474
|
-
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> => {
|
|
1475
|
-
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
1476
|
-
.none(query, values)
|
|
1477
|
-
.then(<span class="fstat-no" title="function not covered" >()</span> => <span class="cstat-no" title="statement not covered" >null)</span>
|
|
1478
|
-
.catch(errorHandler);
|
|
1597
|
+
<span class="cstat-no" title="statement not covered" > return model[orm.getEntityByModel(model).propertyNames[orm.getEntityByModel(model).columnNames.indexOf(sqlColumn)]];</span>
|
|
1479
1598
|
};
|
|
1480
1599
|
/* ------------------------------------------------------------------------*/
|
|
1481
1600
|
/* Built-in basic CRUD functions ------------------------------------------*/
|
|
@@ -1484,98 +1603,77 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
1484
1603
|
const create = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1485
1604
|
const { columns, values, valuesVar } = <span class="cstat-no" title="statement not covered" >getSqlInsertParts(model);</span>
|
|
1486
1605
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
1487
|
-
INSERT INTO "${getEntityByModel(model).tableName}" ( ${columns} )
|
|
1606
|
+
INSERT INTO "${orm.getEntityByModel(model).tableName}" ( ${columns} )
|
|
1488
1607
|
VALUES ( ${valuesVar} )
|
|
1489
|
-
RETURNING ${getEntityByModel(model).selectColumnsClause};
|
|
1608
|
+
RETURNING ${orm.getEntityByModel(model).selectColumnsClause};
|
|
1490
1609
|
`;
|
|
1491
|
-
<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>
|
|
1492
1611
|
};
|
|
1493
1612
|
// Standard update
|
|
1494
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> => {
|
|
1495
1614
|
const { clause, idVar, values } = <span class="cstat-no" title="statement not covered" >getSqlUpdateParts(model, on);</span>
|
|
1496
1615
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
1497
|
-
UPDATE "${getEntityByModel(model).tableName}"
|
|
1616
|
+
UPDATE "${orm.getEntityByModel(model).tableName}"
|
|
1498
1617
|
SET ${clause}
|
|
1499
|
-
WHERE "${getEntityByModel(model).tableName}".${on} = ${idVar}
|
|
1500
|
-
RETURNING ${getEntityByModel(model).selectColumnsClause};
|
|
1618
|
+
WHERE "${orm.getEntityByModel(model).tableName}".${on} = ${idVar}
|
|
1619
|
+
RETURNING ${orm.getEntityByModel(model).selectColumnsClause};
|
|
1501
1620
|
`;
|
|
1502
|
-
<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>
|
|
1503
1622
|
};
|
|
1504
1623
|
// Standard delete
|
|
1505
1624
|
const _delete = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1506
1625
|
const id = <span class="cstat-no" title="statement not covered" >model.id;</span>
|
|
1507
1626
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
1508
|
-
DELETE FROM "${getEntityByModel(model).tableName}"
|
|
1509
|
-
WHERE "${getEntityByModel(model).tableName}".id = $(id)
|
|
1627
|
+
DELETE FROM "${orm.getEntityByModel(model).tableName}"
|
|
1628
|
+
WHERE "${orm.getEntityByModel(model).tableName}".id = $(id)
|
|
1510
1629
|
`;
|
|
1511
|
-
<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>
|
|
1512
1631
|
};
|
|
1513
1632
|
const deleteMatching = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1514
1633
|
const { whereClause, values } = <span class="cstat-no" title="statement not covered" >getMatchingParts(model);</span>
|
|
1515
1634
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
1516
|
-
DELETE FROM "${getEntityByModel(model).tableName}"
|
|
1635
|
+
DELETE FROM "${orm.getEntityByModel(model).tableName}"
|
|
1517
1636
|
WHERE ${whereClause};
|
|
1518
1637
|
`;
|
|
1519
|
-
<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>
|
|
1520
1639
|
};
|
|
1521
1640
|
const getMatching = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1522
1641
|
const { whereClause, values } = <span class="cstat-no" title="statement not covered" >getMatchingParts(model);</span>
|
|
1523
1642
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
1524
|
-
SELECT ${getEntityByModel(model).selectColumnsClause}
|
|
1525
|
-
FROM "${getEntityByModel(model).tableName}"
|
|
1643
|
+
SELECT ${orm.getEntityByModel(model).selectColumnsClause}
|
|
1644
|
+
FROM "${orm.getEntityByModel(model).tableName}"
|
|
1526
1645
|
WHERE ${whereClause};
|
|
1527
1646
|
`;
|
|
1528
|
-
<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>
|
|
1529
1648
|
};
|
|
1530
1649
|
const getOneOrNoneMatching = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1531
1650
|
const { whereClause, values } = <span class="cstat-no" title="statement not covered" >getMatchingParts(model);</span>
|
|
1532
1651
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
1533
|
-
SELECT ${getEntityByModel(model).selectColumnsClause}
|
|
1534
|
-
FROM "${getEntityByModel(model).tableName}"
|
|
1652
|
+
SELECT ${orm.getEntityByModel(model).selectColumnsClause}
|
|
1653
|
+
FROM "${orm.getEntityByModel(model).tableName}"
|
|
1535
1654
|
WHERE ${whereClause};
|
|
1536
1655
|
`;
|
|
1537
|
-
<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>
|
|
1538
1657
|
};
|
|
1539
1658
|
const getAnyMatching = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1540
1659
|
const { whereClause, values } = <span class="cstat-no" title="statement not covered" >getMatchingParts(model);</span>
|
|
1541
1660
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
1542
|
-
SELECT ${getEntityByModel(model).selectColumnsClause}
|
|
1543
|
-
FROM "${getEntityByModel(model).tableName}"
|
|
1661
|
+
SELECT ${orm.getEntityByModel(model).selectColumnsClause}
|
|
1662
|
+
FROM "${orm.getEntityByModel(model).tableName}"
|
|
1544
1663
|
WHERE ${whereClause};
|
|
1545
1664
|
`;
|
|
1546
|
-
<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>
|
|
1547
1666
|
};
|
|
1548
1667
|
const getAllMatching = <span class="fstat-no" title="function not covered" >(m</span>odel) => {
|
|
1549
1668
|
const { whereClause, values } = <span class="cstat-no" title="statement not covered" >getMatchingParts(model);</span>
|
|
1550
1669
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
1551
|
-
SELECT ${getEntityByModel(model).selectColumnsClause}
|
|
1552
|
-
FROM "${getEntityByModel(model).tableName}"
|
|
1670
|
+
SELECT ${orm.getEntityByModel(model).selectColumnsClause}
|
|
1671
|
+
FROM "${orm.getEntityByModel(model).tableName}"
|
|
1553
1672
|
WHERE ${whereClause};
|
|
1554
1673
|
`;
|
|
1555
|
-
<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>
|
|
1556
1675
|
};
|
|
1557
|
-
return {
|
|
1558
|
-
// Query Helper Function
|
|
1559
|
-
nestClump,
|
|
1560
|
-
clumpIntoGroups,
|
|
1561
|
-
mapToBos,
|
|
1562
|
-
objectifyDatabaseResult,
|
|
1563
|
-
createFromDatabase,
|
|
1564
|
-
createOneFromDatabase,
|
|
1565
|
-
createOneOrNoneFromDatabase,
|
|
1566
|
-
createManyFromDatabase,
|
|
1567
|
-
getSqlInsertParts,
|
|
1568
|
-
getSqlUpdateParts,
|
|
1569
|
-
getMatchingParts,
|
|
1570
|
-
getMatchingPartsObject,
|
|
1571
|
-
getNewWith,
|
|
1572
|
-
getValueBySqlColumn,
|
|
1573
|
-
// Query Functions
|
|
1574
|
-
one,
|
|
1575
|
-
oneOrNone,
|
|
1576
|
-
many,
|
|
1577
|
-
any,
|
|
1578
|
-
none,
|
|
1676
|
+
return Object.assign({}, orm, {
|
|
1579
1677
|
// Built-in basic CRUD functions
|
|
1580
1678
|
create,
|
|
1581
1679
|
update,
|
|
@@ -1585,16 +1683,14 @@ const create = ({ entities: externalEntities, db, logError }) => {
|
|
|
1585
1683
|
getOneOrNoneMatching,
|
|
1586
1684
|
getAnyMatching,
|
|
1587
1685
|
getAllMatching,
|
|
1588
|
-
//
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
db
|
|
1597
|
-
};
|
|
1686
|
+
// Helper Utility functions
|
|
1687
|
+
getSqlInsertParts,
|
|
1688
|
+
getSqlUpdateParts,
|
|
1689
|
+
getMatchingParts,
|
|
1690
|
+
getMatchingPartsObject,
|
|
1691
|
+
getNewWith,
|
|
1692
|
+
getValueBySqlColumn
|
|
1693
|
+
});
|
|
1598
1694
|
};
|
|
1599
1695
|
exports.create = create;
|
|
1600
1696
|
</pre></td></tr>
|
|
@@ -1603,7 +1699,7 @@ exports.create = create;
|
|
|
1603
1699
|
</div><!-- /wrapper -->
|
|
1604
1700
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1605
1701
|
Code coverage
|
|
1606
|
-
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)
|
|
1607
1703
|
</div>
|
|
1608
1704
|
</div>
|
|
1609
1705
|
<script src="../../prettify.js"></script>
|