pure-orm 4.0.0-6 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -20
- package/coverage/clover.xml +377 -583
- 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 +285 -198
- 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 +427 -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 +720 -1153
- 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} +48 -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} +99 -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">63.
|
|
23
|
+
<span class="strong">63.73% </span>
|
|
24
24
|
<span class="quiet">Statements</span>
|
|
25
|
-
<span class='fraction'>
|
|
25
|
+
<span class='fraction'>181/284</span>
|
|
26
26
|
</div>
|
|
27
27
|
<div class='fl pad1y space-right2'>
|
|
28
|
-
<span class="strong">
|
|
28
|
+
<span class="strong">58.12% </span>
|
|
29
29
|
<span class="quiet">Branches</span>
|
|
30
|
-
<span class='fraction'>
|
|
30
|
+
<span class='fraction'>68/117</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">62.
|
|
38
|
+
<span class="strong">62.91% </span>
|
|
39
39
|
<span class="quiet">Lines</span>
|
|
40
|
-
<span class='fraction'>
|
|
40
|
+
<span class='fraction'>173/275</span>
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
43
43
|
<p class="quiet">
|
|
@@ -793,9 +793,66 @@
|
|
|
793
793
|
<a name='L745'></a><a href='#L745'>745</a>
|
|
794
794
|
<a name='L746'></a><a href='#L746'>746</a>
|
|
795
795
|
<a name='L747'></a><a href='#L747'>747</a>
|
|
796
|
-
<a name='L748'></a><a href='#L748'>748</a
|
|
797
|
-
<
|
|
798
|
-
<
|
|
796
|
+
<a name='L748'></a><a href='#L748'>748</a>
|
|
797
|
+
<a name='L749'></a><a href='#L749'>749</a>
|
|
798
|
+
<a name='L750'></a><a href='#L750'>750</a>
|
|
799
|
+
<a name='L751'></a><a href='#L751'>751</a>
|
|
800
|
+
<a name='L752'></a><a href='#L752'>752</a>
|
|
801
|
+
<a name='L753'></a><a href='#L753'>753</a>
|
|
802
|
+
<a name='L754'></a><a href='#L754'>754</a>
|
|
803
|
+
<a name='L755'></a><a href='#L755'>755</a>
|
|
804
|
+
<a name='L756'></a><a href='#L756'>756</a>
|
|
805
|
+
<a name='L757'></a><a href='#L757'>757</a>
|
|
806
|
+
<a name='L758'></a><a href='#L758'>758</a>
|
|
807
|
+
<a name='L759'></a><a href='#L759'>759</a>
|
|
808
|
+
<a name='L760'></a><a href='#L760'>760</a>
|
|
809
|
+
<a name='L761'></a><a href='#L761'>761</a>
|
|
810
|
+
<a name='L762'></a><a href='#L762'>762</a>
|
|
811
|
+
<a name='L763'></a><a href='#L763'>763</a>
|
|
812
|
+
<a name='L764'></a><a href='#L764'>764</a>
|
|
813
|
+
<a name='L765'></a><a href='#L765'>765</a>
|
|
814
|
+
<a name='L766'></a><a href='#L766'>766</a>
|
|
815
|
+
<a name='L767'></a><a href='#L767'>767</a>
|
|
816
|
+
<a name='L768'></a><a href='#L768'>768</a>
|
|
817
|
+
<a name='L769'></a><a href='#L769'>769</a>
|
|
818
|
+
<a name='L770'></a><a href='#L770'>770</a>
|
|
819
|
+
<a name='L771'></a><a href='#L771'>771</a>
|
|
820
|
+
<a name='L772'></a><a href='#L772'>772</a>
|
|
821
|
+
<a name='L773'></a><a href='#L773'>773</a>
|
|
822
|
+
<a name='L774'></a><a href='#L774'>774</a>
|
|
823
|
+
<a name='L775'></a><a href='#L775'>775</a>
|
|
824
|
+
<a name='L776'></a><a href='#L776'>776</a>
|
|
825
|
+
<a name='L777'></a><a href='#L777'>777</a>
|
|
826
|
+
<a name='L778'></a><a href='#L778'>778</a>
|
|
827
|
+
<a name='L779'></a><a href='#L779'>779</a>
|
|
828
|
+
<a name='L780'></a><a href='#L780'>780</a>
|
|
829
|
+
<a name='L781'></a><a href='#L781'>781</a>
|
|
830
|
+
<a name='L782'></a><a href='#L782'>782</a>
|
|
831
|
+
<a name='L783'></a><a href='#L783'>783</a>
|
|
832
|
+
<a name='L784'></a><a href='#L784'>784</a>
|
|
833
|
+
<a name='L785'></a><a href='#L785'>785</a>
|
|
834
|
+
<a name='L786'></a><a href='#L786'>786</a>
|
|
835
|
+
<a name='L787'></a><a href='#L787'>787</a>
|
|
836
|
+
<a name='L788'></a><a href='#L788'>788</a>
|
|
837
|
+
<a name='L789'></a><a href='#L789'>789</a>
|
|
838
|
+
<a name='L790'></a><a href='#L790'>790</a>
|
|
839
|
+
<a name='L791'></a><a href='#L791'>791</a>
|
|
840
|
+
<a name='L792'></a><a href='#L792'>792</a>
|
|
841
|
+
<a name='L793'></a><a href='#L793'>793</a>
|
|
842
|
+
<a name='L794'></a><a href='#L794'>794</a>
|
|
843
|
+
<a name='L795'></a><a href='#L795'>795</a>
|
|
844
|
+
<a name='L796'></a><a href='#L796'>796</a>
|
|
845
|
+
<a name='L797'></a><a href='#L797'>797</a>
|
|
846
|
+
<a name='L798'></a><a href='#L798'>798</a>
|
|
847
|
+
<a name='L799'></a><a href='#L799'>799</a>
|
|
848
|
+
<a name='L800'></a><a href='#L800'>800</a>
|
|
849
|
+
<a name='L801'></a><a href='#L801'>801</a>
|
|
850
|
+
<a name='L802'></a><a href='#L802'>802</a>
|
|
851
|
+
<a name='L803'></a><a href='#L803'>803</a>
|
|
852
|
+
<a name='L804'></a><a href='#L804'>804</a>
|
|
853
|
+
<a name='L805'></a><a href='#L805'>805</a>
|
|
854
|
+
<a name='L806'></a><a href='#L806'>806</a>
|
|
855
|
+
<a name='L807'></a><a href='#L807'>807</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
|
799
856
|
<span class="cline-any cline-neutral"> </span>
|
|
800
857
|
<span class="cline-any cline-neutral"> </span>
|
|
801
858
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -856,10 +913,6 @@
|
|
|
856
913
|
<span class="cline-any cline-neutral"> </span>
|
|
857
914
|
<span class="cline-any cline-neutral"> </span>
|
|
858
915
|
<span class="cline-any cline-yes">1x</span>
|
|
859
|
-
<span class="cline-any cline-neutral"> </span>
|
|
860
|
-
<span class="cline-any cline-neutral"> </span>
|
|
861
|
-
<span class="cline-any cline-neutral"> </span>
|
|
862
|
-
<span class="cline-any cline-neutral"> </span>
|
|
863
916
|
<span class="cline-any cline-yes">8x</span>
|
|
864
917
|
<span class="cline-any cline-neutral"> </span>
|
|
865
918
|
<span class="cline-any cline-yes">50x</span>
|
|
@@ -957,15 +1010,6 @@
|
|
|
957
1010
|
<span class="cline-any cline-yes">38207x</span>
|
|
958
1011
|
<span class="cline-any cline-neutral"> </span>
|
|
959
1012
|
<span class="cline-any cline-neutral"> </span>
|
|
960
|
-
<span class="cline-any cline-yes">8x</span>
|
|
961
|
-
<span class="cline-any cline-no"> </span>
|
|
962
|
-
<span class="cline-any cline-no"> </span>
|
|
963
|
-
<span class="cline-any cline-no"> </span>
|
|
964
|
-
<span class="cline-any cline-neutral"> </span>
|
|
965
|
-
<span class="cline-any cline-neutral"> </span>
|
|
966
|
-
<span class="cline-any cline-no"> </span>
|
|
967
|
-
<span class="cline-any cline-neutral"> </span>
|
|
968
|
-
<span class="cline-any cline-neutral"> </span>
|
|
969
1013
|
<span class="cline-any cline-neutral"> </span>
|
|
970
1014
|
<span class="cline-any cline-neutral"> </span>
|
|
971
1015
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1184,11 +1228,6 @@
|
|
|
1184
1228
|
<span class="cline-any cline-neutral"> </span>
|
|
1185
1229
|
<span class="cline-any cline-neutral"> </span>
|
|
1186
1230
|
<span class="cline-any cline-yes">8x</span>
|
|
1187
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1188
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1189
|
-
<span class="cline-any cline-yes">13x</span>
|
|
1190
|
-
<span class="cline-any cline-no"> </span>
|
|
1191
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1192
1231
|
<span class="cline-any cline-yes">13x</span>
|
|
1193
1232
|
<span class="cline-any cline-yes">13x</span>
|
|
1194
1233
|
<span class="cline-any cline-yes">13x</span>
|
|
@@ -1200,11 +1239,25 @@
|
|
|
1200
1239
|
<span class="cline-any cline-neutral"> </span>
|
|
1201
1240
|
<span class="cline-any cline-neutral"> </span>
|
|
1202
1241
|
<span class="cline-any cline-yes">8x</span>
|
|
1203
|
-
<span class="cline-any cline-
|
|
1242
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1243
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1244
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1245
|
+
<span class="cline-any cline-no"> </span>
|
|
1246
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1247
|
+
<span class="cline-any cline-no"> </span>
|
|
1248
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1249
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1250
|
+
<span class="cline-any cline-no"> </span>
|
|
1251
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1252
|
+
<span class="cline-any cline-no"> </span>
|
|
1253
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1254
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1255
|
+
<span class="cline-any cline-yes">8x</span>
|
|
1204
1256
|
<span class="cline-any cline-yes">4x</span>
|
|
1205
1257
|
<span class="cline-any cline-no"> </span>
|
|
1206
1258
|
<span class="cline-any cline-neutral"> </span>
|
|
1207
1259
|
<span class="cline-any cline-yes">4x</span>
|
|
1260
|
+
<span class="cline-any cline-yes">4x</span>
|
|
1208
1261
|
<span class="cline-any cline-no"> </span>
|
|
1209
1262
|
<span class="cline-any cline-yes">4x</span>
|
|
1210
1263
|
<span class="cline-any cline-no"> </span>
|
|
@@ -1217,7 +1270,6 @@
|
|
|
1217
1270
|
<span class="cline-any cline-neutral"> </span>
|
|
1218
1271
|
<span class="cline-any cline-no"> </span>
|
|
1219
1272
|
<span class="cline-any cline-no"> </span>
|
|
1220
|
-
<span class="cline-any cline-no"> </span>
|
|
1221
1273
|
<span class="cline-any cline-neutral"> </span>
|
|
1222
1274
|
<span class="cline-any cline-no"> </span>
|
|
1223
1275
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1227,65 +1279,57 @@
|
|
|
1227
1279
|
<span class="cline-any cline-neutral"> </span>
|
|
1228
1280
|
<span class="cline-any cline-no"> </span>
|
|
1229
1281
|
<span class="cline-any cline-no"> </span>
|
|
1230
|
-
<span class="cline-any cline-no"> </span>
|
|
1231
1282
|
<span class="cline-any cline-neutral"> </span>
|
|
1232
1283
|
<span class="cline-any cline-no"> </span>
|
|
1233
1284
|
<span class="cline-any cline-neutral"> </span>
|
|
1234
1285
|
<span class="cline-any cline-neutral"> </span>
|
|
1235
1286
|
<span class="cline-any cline-yes">8x</span>
|
|
1236
|
-
<span class="cline-any cline-no"> </span>
|
|
1237
1287
|
<span class="cline-any cline-neutral"> </span>
|
|
1238
1288
|
<span class="cline-any cline-neutral"> </span>
|
|
1239
|
-
<span class="cline-any cline-no"> </span>
|
|
1240
1289
|
<span class="cline-any cline-neutral"> </span>
|
|
1241
1290
|
<span class="cline-any cline-neutral"> </span>
|
|
1242
1291
|
<span class="cline-any cline-neutral"> </span>
|
|
1243
|
-
<span class="cline-any cline-no"> </span>
|
|
1244
1292
|
<span class="cline-any cline-neutral"> </span>
|
|
1245
|
-
<span class="cline-any cline-no"> </span>
|
|
1246
1293
|
<span class="cline-any cline-neutral"> </span>
|
|
1247
|
-
<span class="cline-any cline-no"> </span>
|
|
1248
1294
|
<span class="cline-any cline-neutral"> </span>
|
|
1249
|
-
<span class="cline-any cline-
|
|
1250
|
-
<span class="cline-any cline-no"> </span>
|
|
1251
|
-
<span class="cline-any cline-no"> </span>
|
|
1295
|
+
<span class="cline-any cline-yes">50x</span>
|
|
1252
1296
|
<span class="cline-any cline-neutral"> </span>
|
|
1253
|
-
<span class="cline-any cline-no"> </span>
|
|
1254
1297
|
<span class="cline-any cline-neutral"> </span>
|
|
1298
|
+
<span class="cline-any cline-yes">50x</span>
|
|
1255
1299
|
<span class="cline-any cline-neutral"> </span>
|
|
1256
|
-
<span class="cline-any cline-yes">8x</span>
|
|
1257
|
-
<span class="cline-any cline-no"> </span>
|
|
1258
1300
|
<span class="cline-any cline-neutral"> </span>
|
|
1259
1301
|
<span class="cline-any cline-neutral"> </span>
|
|
1260
|
-
<span class="cline-any cline-no"> </span>
|
|
1261
1302
|
<span class="cline-any cline-neutral"> </span>
|
|
1262
1303
|
<span class="cline-any cline-neutral"> </span>
|
|
1263
1304
|
<span class="cline-any cline-neutral"> </span>
|
|
1264
1305
|
<span class="cline-any cline-neutral"> </span>
|
|
1265
|
-
<span class="cline-any cline-no"> </span>
|
|
1266
1306
|
<span class="cline-any cline-neutral"> </span>
|
|
1267
|
-
<span class="cline-any cline-no"> </span>
|
|
1268
|
-
<span class="cline-any cline-no"> </span>
|
|
1269
|
-
<span class="cline-any cline-no"> </span>
|
|
1270
1307
|
<span class="cline-any cline-neutral"> </span>
|
|
1271
|
-
<span class="cline-any cline-no"> </span>
|
|
1272
1308
|
<span class="cline-any cline-neutral"> </span>
|
|
1309
|
+
<span class="cline-any cline-yes">1x</span>
|
|
1310
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1311
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1312
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1313
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1314
|
+
<span class="cline-any cline-yes">8x</span>
|
|
1315
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1316
|
+
<span class="cline-any cline-yes">8x</span>
|
|
1273
1317
|
<span class="cline-any cline-no"> </span>
|
|
1274
1318
|
<span class="cline-any cline-no"> </span>
|
|
1275
1319
|
<span class="cline-any cline-no"> </span>
|
|
1276
1320
|
<span class="cline-any cline-neutral"> </span>
|
|
1277
1321
|
<span class="cline-any cline-neutral"> </span>
|
|
1278
|
-
<span class="cline-any cline-yes">8x</span>
|
|
1279
1322
|
<span class="cline-any cline-no"> </span>
|
|
1280
1323
|
<span class="cline-any cline-neutral"> </span>
|
|
1281
|
-
<span class="cline-any cline-no"> </span>
|
|
1282
1324
|
<span class="cline-any cline-neutral"> </span>
|
|
1283
1325
|
<span class="cline-any cline-neutral"> </span>
|
|
1284
1326
|
<span class="cline-any cline-neutral"> </span>
|
|
1285
1327
|
<span class="cline-any cline-neutral"> </span>
|
|
1286
1328
|
<span class="cline-any cline-neutral"> </span>
|
|
1287
|
-
<span class="cline-any cline-
|
|
1288
|
-
<span class="cline-any cline-
|
|
1329
|
+
<span class="cline-any cline-yes">8x</span>
|
|
1330
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1331
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1332
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1289
1333
|
<span class="cline-any cline-neutral"> </span>
|
|
1290
1334
|
<span class="cline-any cline-no"> </span>
|
|
1291
1335
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1293,23 +1337,21 @@
|
|
|
1293
1337
|
<span class="cline-any cline-neutral"> </span>
|
|
1294
1338
|
<span class="cline-any cline-neutral"> </span>
|
|
1295
1339
|
<span class="cline-any cline-neutral"> </span>
|
|
1296
|
-
<span class="cline-any cline-
|
|
1297
|
-
<span class="cline-any cline-no"> </span>
|
|
1340
|
+
<span class="cline-any cline-yes">8x</span>
|
|
1298
1341
|
<span class="cline-any cline-neutral"> </span>
|
|
1299
1342
|
<span class="cline-any cline-neutral"> </span>
|
|
1300
1343
|
<span class="cline-any cline-neutral"> </span>
|
|
1301
1344
|
<span class="cline-any cline-neutral"> </span>
|
|
1302
|
-
<span class="cline-any cline-yes">8x</span>
|
|
1303
1345
|
<span class="cline-any cline-no"> </span>
|
|
1304
1346
|
<span class="cline-any cline-neutral"> </span>
|
|
1305
1347
|
<span class="cline-any cline-no"> </span>
|
|
1306
1348
|
<span class="cline-any cline-neutral"> </span>
|
|
1307
1349
|
<span class="cline-any cline-neutral"> </span>
|
|
1308
1350
|
<span class="cline-any cline-neutral"> </span>
|
|
1351
|
+
<span class="cline-any cline-yes">8x</span>
|
|
1352
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1309
1353
|
<span class="cline-any cline-neutral"> </span>
|
|
1310
1354
|
<span class="cline-any cline-neutral"> </span>
|
|
1311
|
-
<span class="cline-any cline-no"> </span>
|
|
1312
|
-
<span class="cline-any cline-no"> </span>
|
|
1313
1355
|
<span class="cline-any cline-neutral"> </span>
|
|
1314
1356
|
<span class="cline-any cline-no"> </span>
|
|
1315
1357
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1317,7 +1359,9 @@
|
|
|
1317
1359
|
<span class="cline-any cline-neutral"> </span>
|
|
1318
1360
|
<span class="cline-any cline-neutral"> </span>
|
|
1319
1361
|
<span class="cline-any cline-neutral"> </span>
|
|
1320
|
-
<span class="cline-any cline-
|
|
1362
|
+
<span class="cline-any cline-yes">8x</span>
|
|
1363
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1364
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1321
1365
|
<span class="cline-any cline-neutral"> </span>
|
|
1322
1366
|
<span class="cline-any cline-neutral"> </span>
|
|
1323
1367
|
<span class="cline-any cline-no"> </span>
|
|
@@ -1326,26 +1370,25 @@
|
|
|
1326
1370
|
<span class="cline-any cline-no"> </span>
|
|
1327
1371
|
<span class="cline-any cline-neutral"> </span>
|
|
1328
1372
|
<span class="cline-any cline-neutral"> </span>
|
|
1373
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1374
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1375
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1376
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1377
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1329
1378
|
<span class="cline-any cline-yes">8x</span>
|
|
1330
|
-
<span class="cline-any cline-no"> </span>
|
|
1331
|
-
<span class="cline-any cline-no"> </span>
|
|
1332
1379
|
<span class="cline-any cline-neutral"> </span>
|
|
1333
|
-
<span class="cline-any cline-no"> </span>
|
|
1334
1380
|
<span class="cline-any cline-neutral"> </span>
|
|
1335
1381
|
<span class="cline-any cline-neutral"> </span>
|
|
1336
1382
|
<span class="cline-any cline-neutral"> </span>
|
|
1337
1383
|
<span class="cline-any cline-no"> </span>
|
|
1338
1384
|
<span class="cline-any cline-neutral"> </span>
|
|
1339
1385
|
<span class="cline-any cline-no"> </span>
|
|
1340
|
-
<span class="cline-any cline-no"> </span>
|
|
1341
1386
|
<span class="cline-any cline-neutral"> </span>
|
|
1342
1387
|
<span class="cline-any cline-neutral"> </span>
|
|
1343
1388
|
<span class="cline-any cline-neutral"> </span>
|
|
1344
|
-
<span class="cline-any cline-
|
|
1389
|
+
<span class="cline-any cline-yes">8x</span>
|
|
1345
1390
|
<span class="cline-any cline-neutral"> </span>
|
|
1346
1391
|
<span class="cline-any cline-neutral"> </span>
|
|
1347
|
-
<span class="cline-any cline-yes">8x</span>
|
|
1348
|
-
<span class="cline-any cline-no"> </span>
|
|
1349
1392
|
<span class="cline-any cline-neutral"> </span>
|
|
1350
1393
|
<span class="cline-any cline-neutral"> </span>
|
|
1351
1394
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1355,14 +1398,14 @@
|
|
|
1355
1398
|
<span class="cline-any cline-neutral"> </span>
|
|
1356
1399
|
<span class="cline-any cline-neutral"> </span>
|
|
1357
1400
|
<span class="cline-any cline-neutral"> </span>
|
|
1358
|
-
<span class="cline-any cline-yes">8x</span>
|
|
1359
1401
|
<span class="cline-any cline-neutral"> </span>
|
|
1360
1402
|
<span class="cline-any cline-neutral"> </span>
|
|
1361
1403
|
<span class="cline-any cline-neutral"> </span>
|
|
1362
1404
|
<span class="cline-any cline-neutral"> </span>
|
|
1363
|
-
<span class="cline-any cline-no"> </span>
|
|
1364
1405
|
<span class="cline-any cline-neutral"> </span>
|
|
1365
|
-
<span class="cline-any cline-
|
|
1406
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1407
|
+
<span class="cline-any cline-yes">1x</span>
|
|
1408
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1366
1409
|
<span class="cline-any cline-neutral"> </span>
|
|
1367
1410
|
<span class="cline-any cline-neutral"> </span>
|
|
1368
1411
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1371,24 +1414,44 @@
|
|
|
1371
1414
|
<span class="cline-any cline-neutral"> </span>
|
|
1372
1415
|
<span class="cline-any cline-neutral"> </span>
|
|
1373
1416
|
<span class="cline-any cline-neutral"> </span>
|
|
1417
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1418
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1419
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1420
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1421
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1422
|
+
<span class="cline-any cline-yes">8x</span>
|
|
1374
1423
|
<span class="cline-any cline-no"> </span>
|
|
1375
1424
|
<span class="cline-any cline-neutral"> </span>
|
|
1425
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1426
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1376
1427
|
<span class="cline-any cline-no"> </span>
|
|
1377
1428
|
<span class="cline-any cline-neutral"> </span>
|
|
1378
1429
|
<span class="cline-any cline-neutral"> </span>
|
|
1379
1430
|
<span class="cline-any cline-neutral"> </span>
|
|
1380
|
-
<span class="cline-any cline-yes">8x</span>
|
|
1381
1431
|
<span class="cline-any cline-neutral"> </span>
|
|
1382
1432
|
<span class="cline-any cline-neutral"> </span>
|
|
1433
|
+
<span class="cline-any cline-no"> </span>
|
|
1434
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1435
|
+
<span class="cline-any cline-no"> </span>
|
|
1383
1436
|
<span class="cline-any cline-neutral"> </span>
|
|
1384
1437
|
<span class="cline-any cline-neutral"> </span>
|
|
1385
1438
|
<span class="cline-any cline-no"> </span>
|
|
1386
1439
|
<span class="cline-any cline-neutral"> </span>
|
|
1387
1440
|
<span class="cline-any cline-no"> </span>
|
|
1441
|
+
<span class="cline-any cline-no"> </span>
|
|
1442
|
+
<span class="cline-any cline-no"> </span>
|
|
1388
1443
|
<span class="cline-any cline-neutral"> </span>
|
|
1444
|
+
<span class="cline-any cline-no"> </span>
|
|
1389
1445
|
<span class="cline-any cline-neutral"> </span>
|
|
1390
1446
|
<span class="cline-any cline-neutral"> </span>
|
|
1391
1447
|
<span class="cline-any cline-yes">8x</span>
|
|
1448
|
+
<span class="cline-any cline-no"> </span>
|
|
1449
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1450
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1451
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1452
|
+
<span class="cline-any cline-no"> </span>
|
|
1453
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1454
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1392
1455
|
<span class="cline-any cline-neutral"> </span>
|
|
1393
1456
|
<span class="cline-any cline-neutral"> </span>
|
|
1394
1457
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1396,58 +1459,82 @@
|
|
|
1396
1459
|
<span class="cline-any cline-no"> </span>
|
|
1397
1460
|
<span class="cline-any cline-neutral"> </span>
|
|
1398
1461
|
<span class="cline-any cline-no"> </span>
|
|
1462
|
+
<span class="cline-any cline-no"> </span>
|
|
1463
|
+
<span class="cline-any cline-no"> </span>
|
|
1464
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1399
1465
|
<span class="cline-any cline-neutral"> </span>
|
|
1466
|
+
<span class="cline-any cline-no"> </span>
|
|
1467
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1468
|
+
<span class="cline-any cline-no"> </span>
|
|
1469
|
+
<span class="cline-any cline-no"> </span>
|
|
1470
|
+
<span class="cline-any cline-no"> </span>
|
|
1400
1471
|
<span class="cline-any cline-neutral"> </span>
|
|
1401
1472
|
<span class="cline-any cline-neutral"> </span>
|
|
1402
1473
|
<span class="cline-any cline-yes">8x</span>
|
|
1474
|
+
<span class="cline-any cline-no"> </span>
|
|
1403
1475
|
<span class="cline-any cline-neutral"> </span>
|
|
1404
1476
|
<span class="cline-any cline-neutral"> </span>
|
|
1477
|
+
<span class="cline-any cline-no"> </span>
|
|
1478
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1405
1479
|
<span class="cline-any cline-neutral"> </span>
|
|
1406
1480
|
<span class="cline-any cline-neutral"> </span>
|
|
1481
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1482
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1483
|
+
<span class="cline-any cline-no"> </span>
|
|
1407
1484
|
<span class="cline-any cline-no"> </span>
|
|
1408
1485
|
<span class="cline-any cline-neutral"> </span>
|
|
1409
1486
|
<span class="cline-any cline-no"> </span>
|
|
1410
1487
|
<span class="cline-any cline-neutral"> </span>
|
|
1411
1488
|
<span class="cline-any cline-neutral"> </span>
|
|
1489
|
+
<span class="cline-any cline-no"> </span>
|
|
1490
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1412
1491
|
<span class="cline-any cline-neutral"> </span>
|
|
1413
1492
|
<span class="cline-any cline-neutral"> </span>
|
|
1493
|
+
<span class="cline-any cline-no"> </span>
|
|
1494
|
+
<span class="cline-any cline-no"> </span>
|
|
1414
1495
|
<span class="cline-any cline-neutral"> </span>
|
|
1415
1496
|
<span class="cline-any cline-neutral"> </span>
|
|
1416
1497
|
<span class="cline-any cline-neutral"> </span>
|
|
1417
1498
|
<span class="cline-any cline-neutral"> </span>
|
|
1418
1499
|
<span class="cline-any cline-yes">8x</span>
|
|
1419
1500
|
<span class="cline-any cline-no"> </span>
|
|
1501
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1502
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1420
1503
|
<span class="cline-any cline-no"> </span>
|
|
1421
1504
|
<span class="cline-any cline-neutral"> </span>
|
|
1422
1505
|
<span class="cline-any cline-neutral"> </span>
|
|
1423
1506
|
<span class="cline-any cline-neutral"> </span>
|
|
1424
1507
|
<span class="cline-any cline-neutral"> </span>
|
|
1508
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1509
|
+
<span class="cline-any cline-no"> </span>
|
|
1425
1510
|
<span class="cline-any cline-no"> </span>
|
|
1426
1511
|
<span class="cline-any cline-neutral"> </span>
|
|
1512
|
+
<span class="cline-any cline-no"> </span>
|
|
1427
1513
|
<span class="cline-any cline-neutral"> </span>
|
|
1428
1514
|
<span class="cline-any cline-neutral"> </span>
|
|
1429
|
-
<span class="cline-any cline-yes">8x</span>
|
|
1430
|
-
<span class="cline-any cline-no"> </span>
|
|
1431
1515
|
<span class="cline-any cline-no"> </span>
|
|
1432
1516
|
<span class="cline-any cline-neutral"> </span>
|
|
1433
1517
|
<span class="cline-any cline-neutral"> </span>
|
|
1434
1518
|
<span class="cline-any cline-neutral"> </span>
|
|
1519
|
+
<span class="cline-any cline-no"> </span>
|
|
1435
1520
|
<span class="cline-any cline-neutral"> </span>
|
|
1436
1521
|
<span class="cline-any cline-neutral"> </span>
|
|
1437
1522
|
<span class="cline-any cline-no"> </span>
|
|
1438
1523
|
<span class="cline-any cline-neutral"> </span>
|
|
1439
1524
|
<span class="cline-any cline-neutral"> </span>
|
|
1525
|
+
<span class="cline-any cline-no"> </span>
|
|
1526
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1440
1527
|
<span class="cline-any cline-neutral"> </span>
|
|
1441
1528
|
<span class="cline-any cline-yes">8x</span>
|
|
1442
1529
|
<span class="cline-any cline-no"> </span>
|
|
1443
1530
|
<span class="cline-any cline-no"> </span>
|
|
1444
1531
|
<span class="cline-any cline-neutral"> </span>
|
|
1532
|
+
<span class="cline-any cline-no"> </span>
|
|
1445
1533
|
<span class="cline-any cline-neutral"> </span>
|
|
1446
1534
|
<span class="cline-any cline-neutral"> </span>
|
|
1447
|
-
<span class="cline-any cline-no"> </span>
|
|
1448
1535
|
<span class="cline-any cline-neutral"> </span>
|
|
1536
|
+
<span class="cline-any cline-no"> </span>
|
|
1449
1537
|
<span class="cline-any cline-neutral"> </span>
|
|
1450
|
-
<span class="cline-any cline-yes">8x</span>
|
|
1451
1538
|
<span class="cline-any cline-no"> </span>
|
|
1452
1539
|
<span class="cline-any cline-no"> </span>
|
|
1453
1540
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1458,6 +1545,19 @@
|
|
|
1458
1545
|
<span class="cline-any cline-neutral"> </span>
|
|
1459
1546
|
<span class="cline-any cline-yes">8x</span>
|
|
1460
1547
|
<span class="cline-any cline-no"> </span>
|
|
1548
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1549
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1550
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1551
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1552
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1553
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1554
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1555
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1556
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1557
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1558
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1559
|
+
<span class="cline-any cline-yes">8x</span>
|
|
1560
|
+
<span class="cline-any cline-no"> </span>
|
|
1461
1561
|
<span class="cline-any cline-no"> </span>
|
|
1462
1562
|
<span class="cline-any cline-neutral"> </span>
|
|
1463
1563
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1466,6 +1566,7 @@
|
|
|
1466
1566
|
<span class="cline-any cline-no"> </span>
|
|
1467
1567
|
<span class="cline-any cline-neutral"> </span>
|
|
1468
1568
|
<span class="cline-any cline-neutral"> </span>
|
|
1569
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1469
1570
|
<span class="cline-any cline-yes">8x</span>
|
|
1470
1571
|
<span class="cline-any cline-no"> </span>
|
|
1471
1572
|
<span class="cline-any cline-no"> </span>
|
|
@@ -1473,16 +1574,24 @@
|
|
|
1473
1574
|
<span class="cline-any cline-neutral"> </span>
|
|
1474
1575
|
<span class="cline-any cline-neutral"> </span>
|
|
1475
1576
|
<span class="cline-any cline-neutral"> </span>
|
|
1577
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1476
1578
|
<span class="cline-any cline-no"> </span>
|
|
1477
1579
|
<span class="cline-any cline-neutral"> </span>
|
|
1478
1580
|
<span class="cline-any cline-neutral"> </span>
|
|
1581
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1479
1582
|
<span class="cline-any cline-yes">8x</span>
|
|
1583
|
+
<span class="cline-any cline-no"> </span>
|
|
1584
|
+
<span class="cline-any cline-no"> </span>
|
|
1585
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1480
1586
|
<span class="cline-any cline-neutral"> </span>
|
|
1481
1587
|
<span class="cline-any cline-neutral"> </span>
|
|
1482
|
-
<span class="cline-any cline-no"> </span>
|
|
1483
1588
|
<span class="cline-any cline-no"> </span>
|
|
1484
1589
|
<span class="cline-any cline-neutral"> </span>
|
|
1485
1590
|
<span class="cline-any cline-neutral"> </span>
|
|
1591
|
+
<span class="cline-any cline-yes">8x</span>
|
|
1592
|
+
<span class="cline-any cline-no"> </span>
|
|
1593
|
+
<span class="cline-any cline-no"> </span>
|
|
1594
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1486
1595
|
<span class="cline-any cline-neutral"> </span>
|
|
1487
1596
|
<span class="cline-any cline-neutral"> </span>
|
|
1488
1597
|
<span class="cline-any cline-no"> </span>
|
|
@@ -1499,26 +1608,38 @@
|
|
|
1499
1608
|
<span class="cline-any cline-neutral"> </span>
|
|
1500
1609
|
<span class="cline-any cline-neutral"> </span>
|
|
1501
1610
|
<span class="cline-any cline-yes">8x</span>
|
|
1611
|
+
<span class="cline-any cline-no"> </span>
|
|
1612
|
+
<span class="cline-any cline-no"> </span>
|
|
1502
1613
|
<span class="cline-any cline-neutral"> </span>
|
|
1503
1614
|
<span class="cline-any cline-neutral"> </span>
|
|
1504
1615
|
<span class="cline-any cline-neutral"> </span>
|
|
1505
1616
|
<span class="cline-any cline-neutral"> </span>
|
|
1617
|
+
<span class="cline-any cline-no"> </span>
|
|
1506
1618
|
<span class="cline-any cline-neutral"> </span>
|
|
1507
1619
|
<span class="cline-any cline-neutral"> </span>
|
|
1620
|
+
<span class="cline-any cline-yes">8x</span>
|
|
1508
1621
|
<span class="cline-any cline-neutral"> </span>
|
|
1509
1622
|
<span class="cline-any cline-neutral"> </span>
|
|
1623
|
+
<span class="cline-any cline-no"> </span>
|
|
1624
|
+
<span class="cline-any cline-no"> </span>
|
|
1510
1625
|
<span class="cline-any cline-neutral"> </span>
|
|
1511
1626
|
<span class="cline-any cline-neutral"> </span>
|
|
1512
1627
|
<span class="cline-any cline-neutral"> </span>
|
|
1513
1628
|
<span class="cline-any cline-neutral"> </span>
|
|
1629
|
+
<span class="cline-any cline-no"> </span>
|
|
1514
1630
|
<span class="cline-any cline-neutral"> </span>
|
|
1515
1631
|
<span class="cline-any cline-neutral"> </span>
|
|
1632
|
+
<span class="cline-any cline-yes">8x</span>
|
|
1633
|
+
<span class="cline-any cline-no"> </span>
|
|
1634
|
+
<span class="cline-any cline-no"> </span>
|
|
1516
1635
|
<span class="cline-any cline-neutral"> </span>
|
|
1517
1636
|
<span class="cline-any cline-neutral"> </span>
|
|
1518
1637
|
<span class="cline-any cline-neutral"> </span>
|
|
1519
1638
|
<span class="cline-any cline-neutral"> </span>
|
|
1639
|
+
<span class="cline-any cline-no"> </span>
|
|
1520
1640
|
<span class="cline-any cline-neutral"> </span>
|
|
1521
1641
|
<span class="cline-any cline-neutral"> </span>
|
|
1642
|
+
<span class="cline-any cline-yes">8x</span>
|
|
1522
1643
|
<span class="cline-any cline-neutral"> </span>
|
|
1523
1644
|
<span class="cline-any cline-neutral"> </span>
|
|
1524
1645
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1531,10 +1652,7 @@
|
|
|
1531
1652
|
<span class="cline-any cline-neutral"> </span>
|
|
1532
1653
|
<span class="cline-any cline-neutral"> </span>
|
|
1533
1654
|
<span class="cline-any cline-neutral"> </span>
|
|
1534
|
-
<span class="cline-any cline-yes">50x</span>
|
|
1535
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1536
1655
|
<span class="cline-any cline-neutral"> </span>
|
|
1537
|
-
<span class="cline-any cline-yes">50x</span>
|
|
1538
1656
|
<span class="cline-any cline-neutral"> </span>
|
|
1539
1657
|
<span class="cline-any cline-neutral"> </span>
|
|
1540
1658
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1596,17 +1714,11 @@ export interface IEntityInternal<T extends IModel> {
|
|
|
1596
1714
|
}
|
|
1597
1715
|
export type IEntitiesInternal<T extends IModel> = Array<IEntityInternal<T>>;
|
|
1598
1716
|
|
|
1599
|
-
export interface
|
|
1717
|
+
export interface CreateOrmOptions {
|
|
1600
1718
|
entities: IEntities<IModel>;
|
|
1601
|
-
db: any;
|
|
1602
|
-
logError?: (err: Error) => void;
|
|
1603
1719
|
}
|
|
1604
1720
|
|
|
1605
|
-
export const
|
|
1606
|
-
entities: externalEntities,
|
|
1607
|
-
db,
|
|
1608
|
-
logError
|
|
1609
|
-
}: CreateOptions) => {
|
|
1721
|
+
export const createOrm = ({ entities: externalEntities }: CreateOrmOptions) => {
|
|
1610
1722
|
const entities: IEntitiesInternal<IModel> = externalEntities.map(
|
|
1611
1723
|
(d: IEntity<IModel>) => {
|
|
1612
1724
|
const tableName = d.tableName;
|
|
@@ -1703,15 +1815,6 @@ export const create = ({
|
|
|
1703
1815
|
}
|
|
1704
1816
|
return entity;
|
|
1705
1817
|
};
|
|
1706
|
-
|
|
1707
|
-
const defaultErrorHandler = <span class="fstat-no" title="function not covered" >(e</span>rr: Error) => {
|
|
1708
|
-
<span class="cstat-no" title="statement not covered" > if (!(err.name === 'QueryResultError')) {</span>
|
|
1709
|
-
<span class="cstat-no" title="statement not covered" > if (logError) {</span>
|
|
1710
|
-
<span class="cstat-no" title="statement not covered" > logError(err);</span>
|
|
1711
|
-
}
|
|
1712
|
-
}
|
|
1713
|
-
<span class="cstat-no" title="statement not covered" > throw err;</span>
|
|
1714
|
-
};
|
|
1715
1818
|
|
|
1716
1819
|
/*
|
|
1717
1820
|
* In:
|
|
@@ -1930,66 +2033,213 @@ export const create = ({
|
|
|
1930
2033
|
}, {});
|
|
1931
2034
|
};
|
|
1932
2035
|
|
|
1933
|
-
const createFromDatabase = <T extends ICollection<IModel>>(
|
|
1934
|
-
|
|
1935
|
-
): T | undefined => {
|
|
1936
|
-
<span class="missing-if-branch" title="if path not taken" >I</span>if (!_result || !_result.length) {
|
|
1937
|
-
<span class="cstat-no" title="statement not covered" > return void 0;</span>
|
|
1938
|
-
}
|
|
1939
|
-
const result = Array.isArray(_result) ? _result : <span class="branch-1 cbranch-no" title="branch not covered" >[_result];</span>
|
|
2036
|
+
const createFromDatabase = <T extends ICollection<IModel>>(rows: any): T => {
|
|
2037
|
+
const result = Array.isArray(rows) ? rows : <span class="branch-1 cbranch-no" title="branch not covered" >[rows];</span>
|
|
1940
2038
|
const objectified = result.map(objectifyDatabaseResult);
|
|
1941
2039
|
const boified = objectified.map(mapToBos);
|
|
1942
2040
|
const clumps = clumpIntoGroups(boified);
|
|
1943
2041
|
const nested = clumps.map(nestClump);
|
|
1944
2042
|
const models = nested.map((n) => Object.values(n)[0]);
|
|
1945
2043
|
const Collection = getEntityByModel(models[0]).Collection;
|
|
1946
|
-
return
|
|
2044
|
+
return <T>new Collection({ models });
|
|
2045
|
+
};
|
|
2046
|
+
|
|
2047
|
+
const createAnyFromDatabase = <span class="fstat-no" title="function not covered" ><T</span> extends ICollection<IModel>>(
|
|
2048
|
+
rows: any,
|
|
2049
|
+
rootKey: string | IModel
|
|
2050
|
+
): T => {
|
|
2051
|
+
<span class="cstat-no" title="statement not covered" > if (!rows || !rows.length) {</span>
|
|
2052
|
+
const Collection =
|
|
2053
|
+
<span class="cstat-no" title="statement not covered" > typeof rootKey === 'string'</span>
|
|
2054
|
+
? getEntityByTableName(rootKey).Collection
|
|
2055
|
+
: getEntityByModel(rootKey).Collection;
|
|
2056
|
+
<span class="cstat-no" title="statement not covered" > return new Collection({ models: [] }) as T;</span>
|
|
2057
|
+
}
|
|
2058
|
+
<span class="cstat-no" title="statement not covered" > return <T>createFromDatabase<T>(rows);</span>
|
|
1947
2059
|
};
|
|
1948
2060
|
|
|
1949
|
-
const createOneFromDatabase = <T extends IModel>(
|
|
1950
|
-
|
|
1951
|
-
<span class="missing-if-branch" title="if path not taken" >I</span>if (!collection) {
|
|
2061
|
+
const createOneFromDatabase = <T extends IModel>(rows: any): T => {
|
|
2062
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (!rows || !rows.length) {
|
|
1952
2063
|
<span class="cstat-no" title="statement not covered" > throw Error('Did not get one.');</span>
|
|
1953
2064
|
}
|
|
1954
|
-
|
|
2065
|
+
const collection = createFromDatabase<ICollection<IModel>>(rows);
|
|
2066
|
+
<span class="missing-if-branch" title="if path not taken" >I</span>if (!collection || !collection.models || collection.models.length === 0) {
|
|
1955
2067
|
<span class="cstat-no" title="statement not covered" > throw Error('Did not get one.');</span>
|
|
1956
2068
|
} else <span class="missing-if-branch" title="if path not taken" >I</span>if (collection.models.length > 1) {
|
|
1957
2069
|
<span class="cstat-no" title="statement not covered" > throw Error('Got more than one.');</span>
|
|
1958
2070
|
}
|
|
1959
|
-
return collection.models[0]
|
|
2071
|
+
return <T>collection.models[0];
|
|
1960
2072
|
};
|
|
1961
2073
|
|
|
1962
2074
|
const createOneOrNoneFromDatabase = <span class="fstat-no" title="function not covered" ><T</span> extends IModel>(
|
|
1963
|
-
|
|
2075
|
+
rows: any
|
|
1964
2076
|
): T | void => {
|
|
1965
|
-
|
|
1966
|
-
<span class="cstat-no" title="statement not covered" >
|
|
1967
|
-
<span class="cstat-no" title="statement not covered" > throw Error('Got more than one.');</span>
|
|
2077
|
+
<span class="cstat-no" title="statement not covered" > if (!rows || !rows.length) {</span>
|
|
2078
|
+
<span class="cstat-no" title="statement not covered" > return void 0;</span>
|
|
1968
2079
|
}
|
|
1969
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
2080
|
+
<span class="cstat-no" title="statement not covered" > return <T>createOneFromDatabase(rows);</span>
|
|
1970
2081
|
};
|
|
1971
2082
|
|
|
1972
2083
|
const createManyFromDatabase = <span class="fstat-no" title="function not covered" ><T</span> extends ICollection<IModel>>(
|
|
1973
|
-
|
|
2084
|
+
rows: any
|
|
1974
2085
|
): T => {
|
|
1975
|
-
|
|
1976
|
-
<span class="cstat-no" title="statement not covered" > if (!collection || collection.models.length === 0) {</span>
|
|
2086
|
+
<span class="cstat-no" title="statement not covered" > if (!rows || !rows.length) {</span>
|
|
1977
2087
|
<span class="cstat-no" title="statement not covered" > throw Error('Did not get at least one.');</span>
|
|
1978
2088
|
}
|
|
1979
|
-
<span class="cstat-no" title="statement not covered" > return
|
|
2089
|
+
<span class="cstat-no" title="statement not covered" > return <T>createFromDatabase(rows);</span>
|
|
1980
2090
|
};
|
|
2091
|
+
|
|
2092
|
+
return {
|
|
2093
|
+
getEntityByModel,
|
|
2094
|
+
createFromDatabase,
|
|
2095
|
+
createAnyFromDatabase,
|
|
2096
|
+
createOneFromDatabase,
|
|
2097
|
+
createOneOrNoneFromDatabase,
|
|
2098
|
+
createManyFromDatabase,
|
|
2099
|
+
// tables property for access to select columns clause string
|
|
2100
|
+
tables: entities.reduce((accum: any, data: IEntityInternal<IModel>) => {
|
|
2101
|
+
accum[data.displayName] = {
|
|
2102
|
+
columns: data.selectColumnsClause
|
|
2103
|
+
};
|
|
2104
|
+
return accum;
|
|
2105
|
+
}, {})
|
|
2106
|
+
};
|
|
2107
|
+
};
|
|
2108
|
+
|
|
2109
|
+
export interface CreateAbstractionLayerOptions {
|
|
2110
|
+
entities: IEntities<IModel>;
|
|
2111
|
+
db: any;
|
|
2112
|
+
logError?: (err: Error) => void;
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
export const createAbstractionLayer = ({
|
|
2116
|
+
entities: externalEntities,
|
|
2117
|
+
db,
|
|
2118
|
+
logError
|
|
2119
|
+
}: CreateAbstractionLayerOptions) => {
|
|
2120
|
+
const orm = createOrm({ entities: externalEntities });
|
|
2121
|
+
|
|
2122
|
+
const defaultErrorHandler = <span class="fstat-no" title="function not covered" >(e</span>rr: Error) => {
|
|
2123
|
+
<span class="cstat-no" title="statement not covered" > if (!(err.name === 'QueryResultError')) {</span>
|
|
2124
|
+
<span class="cstat-no" title="statement not covered" > if (logError) {</span>
|
|
2125
|
+
<span class="cstat-no" title="statement not covered" > logError(err);</span>
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
<span class="cstat-no" title="statement not covered" > throw err;</span>
|
|
2129
|
+
};
|
|
2130
|
+
|
|
2131
|
+
/* ------------------------------------------------------------------------*/
|
|
2132
|
+
/* Query functions --------------------------------------------------------*/
|
|
2133
|
+
/* ------------------------------------------------------------------------*/
|
|
2134
|
+
|
|
2135
|
+
const one = <span class="fstat-no" title="function not covered" ><T</span> extends IModel>(
|
|
2136
|
+
query: string,
|
|
2137
|
+
values?: object,
|
|
2138
|
+
errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler</span>
|
|
2139
|
+
): T => {
|
|
2140
|
+
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
2141
|
+
.many(query, values)
|
|
2142
|
+
.then(<span class="fstat-no" title="function not covered" >(r</span>ows: any) => <span class="cstat-no" title="statement not covered" >orm.createOneFromDatabase(rows))</span>
|
|
2143
|
+
.catch(errorHandler);
|
|
2144
|
+
};
|
|
2145
|
+
|
|
2146
|
+
const oneOrNone = <span class="fstat-no" title="function not covered" ><T</span> extends IModel>(
|
|
2147
|
+
query: string,
|
|
2148
|
+
values?: object,
|
|
2149
|
+
errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler</span>
|
|
2150
|
+
): T | void => {
|
|
2151
|
+
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
2152
|
+
.any(query, values)
|
|
2153
|
+
.then(<span class="fstat-no" title="function not covered" >(r</span>ows: any) => <span class="cstat-no" title="statement not covered" >orm.createOneOrNoneFromDatabase(rows))</span>
|
|
2154
|
+
.catch(errorHandler);
|
|
2155
|
+
};
|
|
2156
|
+
|
|
2157
|
+
const many = <span class="fstat-no" title="function not covered" ><T</span> extends ICollection<IModel>>(
|
|
2158
|
+
query: string,
|
|
2159
|
+
values?: object,
|
|
2160
|
+
errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler</span>
|
|
2161
|
+
): T => {
|
|
2162
|
+
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
2163
|
+
.any(query, values)
|
|
2164
|
+
.then(<span class="fstat-no" title="function not covered" >(r</span>ows: any) => <span class="cstat-no" title="statement not covered" >orm.createManyFromDatabase(rows))</span>
|
|
2165
|
+
.catch(errorHandler);
|
|
2166
|
+
};
|
|
2167
|
+
|
|
2168
|
+
const any = <span class="fstat-no" title="function not covered" ><T</span> extends ICollection<IModel>>(
|
|
2169
|
+
query: string,
|
|
2170
|
+
values?: object,
|
|
2171
|
+
errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler</span>
|
|
2172
|
+
): T | void => {
|
|
2173
|
+
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
2174
|
+
.result(query, values)
|
|
2175
|
+
.then(<span class="fstat-no" title="function not covered" >(r</span>esult: any) =>
|
|
2176
|
+
<span class="cstat-no" title="statement not covered" > orm.createAnyFromDatabase(</span>
|
|
2177
|
+
result.rows,
|
|
2178
|
+
result.fields[0].name.split('#')[0]
|
|
2179
|
+
)
|
|
2180
|
+
)
|
|
2181
|
+
.catch(errorHandler);
|
|
2182
|
+
};
|
|
2183
|
+
|
|
2184
|
+
const none = <span class="fstat-no" title="function not covered" >(</span>
|
|
2185
|
+
query: string,
|
|
2186
|
+
values?: object,
|
|
2187
|
+
errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler</span>
|
|
2188
|
+
): void => {
|
|
2189
|
+
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
2190
|
+
.none(query, values)
|
|
2191
|
+
.then(<span class="fstat-no" title="function not covered" >()</span> => <span class="cstat-no" title="statement not covered" >null)</span>
|
|
2192
|
+
.catch(errorHandler);
|
|
2193
|
+
};
|
|
2194
|
+
|
|
2195
|
+
return Object.assign({}, orm, {
|
|
2196
|
+
// Query Functions
|
|
2197
|
+
one,
|
|
2198
|
+
oneOrNone,
|
|
2199
|
+
many,
|
|
2200
|
+
any,
|
|
2201
|
+
none,
|
|
2202
|
+
// provide direct access to db
|
|
2203
|
+
db
|
|
2204
|
+
});
|
|
2205
|
+
};
|
|
2206
|
+
|
|
2207
|
+
export interface CreateOptions {
|
|
2208
|
+
entities: IEntities<IModel>;
|
|
2209
|
+
db: any;
|
|
2210
|
+
logError?: (err: Error) => void;
|
|
2211
|
+
}
|
|
2212
|
+
|
|
2213
|
+
export const create = ({
|
|
2214
|
+
entities: externalEntities,
|
|
2215
|
+
db,
|
|
2216
|
+
logError
|
|
2217
|
+
}: CreateOptions) => {
|
|
2218
|
+
const orm = createAbstractionLayer({
|
|
2219
|
+
entities: externalEntities,
|
|
2220
|
+
db,
|
|
2221
|
+
logError
|
|
2222
|
+
});
|
|
2223
|
+
|
|
2224
|
+
/* ------------------------------------------------------------------------*/
|
|
2225
|
+
/* Helper Utilities for CRUD functions ------------------------------------*/
|
|
2226
|
+
/* ------------------------------------------------------------------------*/
|
|
1981
2227
|
|
|
1982
2228
|
const getSqlInsertParts = <span class="fstat-no" title="function not covered" >(m</span>odel: IModel) => {
|
|
1983
|
-
const columns = <span class="cstat-no" title="statement not covered" >
|
|
2229
|
+
const columns = <span class="cstat-no" title="statement not covered" >orm</span>
|
|
2230
|
+
.getEntityByModel(model)
|
|
1984
2231
|
.columnNames.filter(
|
|
1985
2232
|
<span class="fstat-no" title="function not covered" > (c</span>olumn: string, index: number) =>
|
|
1986
2233
|
<span class="cstat-no" title="statement not covered" > model[</span>
|
|
1987
|
-
getEntityByModel(model).propertyNames[
|
|
2234
|
+
orm.getEntityByModel(model).propertyNames[
|
|
2235
|
+
index
|
|
2236
|
+
] as keyof typeof model
|
|
1988
2237
|
] !== void 0
|
|
1989
2238
|
)
|
|
1990
2239
|
.map(<span class="fstat-no" title="function not covered" >(c</span>ol: string) => <span class="cstat-no" title="statement not covered" >`"${col}"`)</span>
|
|
1991
2240
|
.join(', ');
|
|
1992
|
-
const values = <span class="cstat-no" title="statement not covered" >
|
|
2241
|
+
const values = <span class="cstat-no" title="statement not covered" >orm</span>
|
|
2242
|
+
.getEntityByModel(model)
|
|
1993
2243
|
.propertyNames.map(
|
|
1994
2244
|
<span class="fstat-no" title="function not covered" > (p</span>roperty: string) => <span class="cstat-no" title="statement not covered" >model[property as keyof typeof model]</span>
|
|
1995
2245
|
)
|
|
@@ -2001,11 +2251,14 @@ export const create = ({
|
|
|
2001
2251
|
};
|
|
2002
2252
|
|
|
2003
2253
|
const getSqlUpdateParts = <span class="fstat-no" title="function not covered" >(m</span>odel: IModel, on = <span class="branch-0 cbranch-no" title="branch not covered" >'id')</span> => {
|
|
2004
|
-
const clauseArray = <span class="cstat-no" title="statement not covered" >
|
|
2254
|
+
const clauseArray = <span class="cstat-no" title="statement not covered" >orm</span>
|
|
2255
|
+
.getEntityByModel(model)
|
|
2005
2256
|
.columnNames.filter(
|
|
2006
2257
|
<span class="fstat-no" title="function not covered" > (s</span>qlColumn: string, index: number) =>
|
|
2007
2258
|
<span class="cstat-no" title="statement not covered" > model[</span>
|
|
2008
|
-
getEntityByModel(model).propertyNames[
|
|
2259
|
+
orm.getEntityByModel(model).propertyNames[
|
|
2260
|
+
index
|
|
2261
|
+
] as keyof typeof model
|
|
2009
2262
|
] !== void 0
|
|
2010
2263
|
)
|
|
2011
2264
|
.map(
|
|
@@ -2013,7 +2266,8 @@ export const create = ({
|
|
|
2013
2266
|
);
|
|
2014
2267
|
const clause = <span class="cstat-no" title="statement not covered" >clauseArray.join(', ');</span>
|
|
2015
2268
|
const idVar = <span class="cstat-no" title="statement not covered" >`$${clauseArray.length + 1}`;</span>
|
|
2016
|
-
const _values = <span class="cstat-no" title="statement not covered" >
|
|
2269
|
+
const _values = <span class="cstat-no" title="statement not covered" >orm</span>
|
|
2270
|
+
.getEntityByModel(model)
|
|
2017
2271
|
.propertyNames.map(
|
|
2018
2272
|
<span class="fstat-no" title="function not covered" > (p</span>roperty: string) => <span class="cstat-no" title="statement not covered" >model[property as keyof typeof model]</span>
|
|
2019
2273
|
)
|
|
@@ -2023,18 +2277,20 @@ export const create = ({
|
|
|
2023
2277
|
};
|
|
2024
2278
|
|
|
2025
2279
|
const getMatchingParts = <span class="fstat-no" title="function not covered" >(m</span>odel: IModel) => {
|
|
2026
|
-
const whereClause = <span class="cstat-no" title="statement not covered" >
|
|
2280
|
+
const whereClause = <span class="cstat-no" title="statement not covered" >orm</span>
|
|
2281
|
+
.getEntityByModel(model)
|
|
2027
2282
|
.propertyNames.map(<span class="fstat-no" title="function not covered" >(p</span>roperty: string, index: number) =>
|
|
2028
2283
|
<span class="cstat-no" title="statement not covered" > model[property as keyof typeof model] != null</span>
|
|
2029
|
-
? `"${getEntityByModel(model).tableName}"."${
|
|
2030
|
-
getEntityByModel(model).columnNames[index]
|
|
2284
|
+
? `"${orm.getEntityByModel(model).tableName}"."${
|
|
2285
|
+
orm.getEntityByModel(model).columnNames[index]
|
|
2031
2286
|
}"`
|
|
2032
2287
|
: null
|
|
2033
2288
|
)
|
|
2034
2289
|
.filter(<span class="fstat-no" title="function not covered" >(x</span>: string | null) => <span class="cstat-no" title="statement not covered" >x != null)</span>
|
|
2035
2290
|
.map(<span class="fstat-no" title="function not covered" >(x</span>: string | null, i: number) => <span class="cstat-no" title="statement not covered" >`${x} = $${i + 1}`)</span>
|
|
2036
2291
|
.join(' AND ');
|
|
2037
|
-
const values = <span class="cstat-no" title="statement not covered" >
|
|
2292
|
+
const values = <span class="cstat-no" title="statement not covered" >orm</span>
|
|
2293
|
+
.getEntityByModel(model)
|
|
2038
2294
|
.propertyNames.map(<span class="fstat-no" title="function not covered" >(p</span>roperty: string) =>
|
|
2039
2295
|
<span class="cstat-no" title="statement not covered" > model[property as keyof typeof model] != null</span>
|
|
2040
2296
|
? model[property as keyof typeof model]
|
|
@@ -2047,18 +2303,20 @@ export const create = ({
|
|
|
2047
2303
|
// This one returns an object, which allows it to be more versatile.
|
|
2048
2304
|
// To-do: make this one even better and use it instead of the one above.
|
|
2049
2305
|
const getMatchingPartsObject = <span class="fstat-no" title="function not covered" >(m</span>odel: IModel) => {
|
|
2050
|
-
const whereClause = <span class="cstat-no" title="statement not covered" >
|
|
2306
|
+
const whereClause = <span class="cstat-no" title="statement not covered" >orm</span>
|
|
2307
|
+
.getEntityByModel(model)
|
|
2051
2308
|
.propertyNames.map(<span class="fstat-no" title="function not covered" >(p</span>roperty: string, index: number) =>
|
|
2052
2309
|
<span class="cstat-no" title="statement not covered" > model[property as keyof typeof model] != null</span>
|
|
2053
|
-
? `"${getEntityByModel(model).tableName}"."${
|
|
2054
|
-
getEntityByModel(model).columnNames[index]
|
|
2310
|
+
? `"${orm.getEntityByModel(model).tableName}"."${
|
|
2311
|
+
orm.getEntityByModel(model).columnNames[index]
|
|
2055
2312
|
}"`
|
|
2056
2313
|
: null
|
|
2057
2314
|
)
|
|
2058
2315
|
.filter(<span class="fstat-no" title="function not covered" >(x</span>: string | null) => <span class="cstat-no" title="statement not covered" >x != null)</span>
|
|
2059
2316
|
.map(<span class="fstat-no" title="function not covered" >(x</span>: string | null, i: number) => <span class="cstat-no" title="statement not covered" >`${x} = $(${i + 1})`)</span>
|
|
2060
2317
|
.join(' AND ');
|
|
2061
|
-
const values = <span class="cstat-no" title="statement not covered" >
|
|
2318
|
+
const values = <span class="cstat-no" title="statement not covered" >orm</span>
|
|
2319
|
+
.getEntityByModel(model)
|
|
2062
2320
|
.propertyNames.map(<span class="fstat-no" title="function not covered" >(p</span>roperty: string) =>
|
|
2063
2321
|
<span class="cstat-no" title="statement not covered" > model[property as keyof typeof model] != null</span>
|
|
2064
2322
|
? model[property as keyof typeof model]
|
|
@@ -2077,8 +2335,8 @@ export const create = ({
|
|
|
2077
2335
|
const Constructor = <span class="cstat-no" title="statement not covered" >model.constructor as any;</span>
|
|
2078
2336
|
const modelKeys = <span class="cstat-no" title="statement not covered" >sqlColumns.map(</span>
|
|
2079
2337
|
<span class="fstat-no" title="function not covered" > (k</span>ey: string) =>
|
|
2080
|
-
<span class="cstat-no" title="statement not covered" > getEntityByModel(model).propertyNames[</span>
|
|
2081
|
-
getEntityByModel(model).columnNames.indexOf(key)
|
|
2338
|
+
<span class="cstat-no" title="statement not covered" > orm.getEntityByModel(model).propertyNames[</span>
|
|
2339
|
+
orm.getEntityByModel(model).columnNames.indexOf(key)
|
|
2082
2340
|
]
|
|
2083
2341
|
);
|
|
2084
2342
|
const modelData = <span class="cstat-no" title="statement not covered" >modelKeys.reduce(</span>
|
|
@@ -2093,69 +2351,11 @@ export const create = ({
|
|
|
2093
2351
|
|
|
2094
2352
|
const getValueBySqlColumn = <span class="fstat-no" title="function not covered" >(m</span>odel: IModel, sqlColumn: string) => {
|
|
2095
2353
|
<span class="cstat-no" title="statement not covered" > return model[</span>
|
|
2096
|
-
getEntityByModel(model).propertyNames[
|
|
2097
|
-
getEntityByModel(model).columnNames.indexOf(sqlColumn)
|
|
2354
|
+
orm.getEntityByModel(model).propertyNames[
|
|
2355
|
+
orm.getEntityByModel(model).columnNames.indexOf(sqlColumn)
|
|
2098
2356
|
] as keyof typeof model
|
|
2099
2357
|
];
|
|
2100
2358
|
};
|
|
2101
|
-
/* ------------------------------------------------------------------------*/
|
|
2102
|
-
/* Query functions --------------------------------------------------------*/
|
|
2103
|
-
/* ------------------------------------------------------------------------*/
|
|
2104
|
-
|
|
2105
|
-
const one = <span class="fstat-no" title="function not covered" ><T</span> extends IModel>(
|
|
2106
|
-
query: string,
|
|
2107
|
-
values?: object,
|
|
2108
|
-
errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler</span>
|
|
2109
|
-
): T => {
|
|
2110
|
-
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
2111
|
-
.many(query, values)
|
|
2112
|
-
.then(<span class="fstat-no" title="function not covered" >(r</span>ows: any) => <span class="cstat-no" title="statement not covered" >createOneFromDatabase(rows))</span>
|
|
2113
|
-
.catch(errorHandler);
|
|
2114
|
-
};
|
|
2115
|
-
|
|
2116
|
-
const oneOrNone = <span class="fstat-no" title="function not covered" ><T</span> extends IModel>(
|
|
2117
|
-
query: string,
|
|
2118
|
-
values?: object,
|
|
2119
|
-
errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler</span>
|
|
2120
|
-
): T | void => {
|
|
2121
|
-
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
2122
|
-
.any(query, values)
|
|
2123
|
-
.then(<span class="fstat-no" title="function not covered" >(r</span>ows: any) => <span class="cstat-no" title="statement not covered" >createOneOrNoneFromDatabase(rows))</span>
|
|
2124
|
-
.catch(errorHandler);
|
|
2125
|
-
};
|
|
2126
|
-
|
|
2127
|
-
const many = <span class="fstat-no" title="function not covered" ><T</span> extends ICollection<IModel>>(
|
|
2128
|
-
query: string,
|
|
2129
|
-
values?: object,
|
|
2130
|
-
errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler</span>
|
|
2131
|
-
): T => {
|
|
2132
|
-
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
2133
|
-
.any(query, values)
|
|
2134
|
-
.then(<span class="fstat-no" title="function not covered" >(r</span>ows: any) => <span class="cstat-no" title="statement not covered" >createManyFromDatabase(rows))</span>
|
|
2135
|
-
.catch(errorHandler);
|
|
2136
|
-
};
|
|
2137
|
-
|
|
2138
|
-
const any = <span class="fstat-no" title="function not covered" ><T</span> extends ICollection<IModel>>(
|
|
2139
|
-
query: string,
|
|
2140
|
-
values?: object,
|
|
2141
|
-
errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler</span>
|
|
2142
|
-
): T | void => {
|
|
2143
|
-
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
2144
|
-
.any(query, values)
|
|
2145
|
-
.then(<span class="fstat-no" title="function not covered" >(r</span>ows: any) => <span class="cstat-no" title="statement not covered" >createFromDatabase(rows))</span>
|
|
2146
|
-
.catch(errorHandler);
|
|
2147
|
-
};
|
|
2148
|
-
|
|
2149
|
-
const none = <span class="fstat-no" title="function not covered" >(</span>
|
|
2150
|
-
query: string,
|
|
2151
|
-
values?: object,
|
|
2152
|
-
errorHandler = <span class="branch-0 cbranch-no" title="branch not covered" >defaultErrorHandler</span>
|
|
2153
|
-
): void => {
|
|
2154
|
-
<span class="cstat-no" title="statement not covered" > return db</span>
|
|
2155
|
-
.none(query, values)
|
|
2156
|
-
.then(<span class="fstat-no" title="function not covered" >()</span> => <span class="cstat-no" title="statement not covered" >null)</span>
|
|
2157
|
-
.catch(errorHandler);
|
|
2158
|
-
};
|
|
2159
2359
|
|
|
2160
2360
|
/* ------------------------------------------------------------------------*/
|
|
2161
2361
|
/* Built-in basic CRUD functions ------------------------------------------*/
|
|
@@ -2165,62 +2365,62 @@ export const create = ({
|
|
|
2165
2365
|
const create = <span class="fstat-no" title="function not covered" ><T</span> extends IModel>(model: T): T => {
|
|
2166
2366
|
const { columns, values, valuesVar } = <span class="cstat-no" title="statement not covered" >getSqlInsertParts(model);</span>
|
|
2167
2367
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
2168
|
-
INSERT INTO "${getEntityByModel(model).tableName}" ( ${columns} )
|
|
2368
|
+
INSERT INTO "${orm.getEntityByModel(model).tableName}" ( ${columns} )
|
|
2169
2369
|
VALUES ( ${valuesVar} )
|
|
2170
|
-
RETURNING ${getEntityByModel(model).selectColumnsClause};
|
|
2370
|
+
RETURNING ${orm.getEntityByModel(model).selectColumnsClause};
|
|
2171
2371
|
`;
|
|
2172
|
-
<span class="cstat-no" title="statement not covered" > return one<T>(query, values);</span>
|
|
2372
|
+
<span class="cstat-no" title="statement not covered" > return orm.one<T>(query, values);</span>
|
|
2173
2373
|
};
|
|
2174
2374
|
|
|
2175
2375
|
// Standard update
|
|
2176
2376
|
const update = <span class="fstat-no" title="function not covered" ><T</span> extends IModel>(model: T, { on = <span class="branch-0 cbranch-no" title="branch not covered" >'id' </span>} = <span class="branch-0 cbranch-no" title="branch not covered" >{})</span>: T => {
|
|
2177
2377
|
const { clause, idVar, values } = <span class="cstat-no" title="statement not covered" >getSqlUpdateParts(model, on);</span>
|
|
2178
2378
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
2179
|
-
UPDATE "${getEntityByModel(model).tableName}"
|
|
2379
|
+
UPDATE "${orm.getEntityByModel(model).tableName}"
|
|
2180
2380
|
SET ${clause}
|
|
2181
|
-
WHERE "${getEntityByModel(model).tableName}".${on} = ${idVar}
|
|
2182
|
-
RETURNING ${getEntityByModel(model).selectColumnsClause};
|
|
2381
|
+
WHERE "${orm.getEntityByModel(model).tableName}".${on} = ${idVar}
|
|
2382
|
+
RETURNING ${orm.getEntityByModel(model).selectColumnsClause};
|
|
2183
2383
|
`;
|
|
2184
|
-
<span class="cstat-no" title="statement not covered" > return one<T>(query, values);</span>
|
|
2384
|
+
<span class="cstat-no" title="statement not covered" > return orm.one<T>(query, values);</span>
|
|
2185
2385
|
};
|
|
2186
2386
|
|
|
2187
2387
|
// Standard delete
|
|
2188
2388
|
const _delete = <span class="fstat-no" title="function not covered" ><T</span> extends IModel>(model: T): void => {
|
|
2189
2389
|
const id = <span class="cstat-no" title="statement not covered" >(model as any).id;</span>
|
|
2190
2390
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
2191
|
-
DELETE FROM "${getEntityByModel(model).tableName}"
|
|
2192
|
-
WHERE "${getEntityByModel(model).tableName}".id = $(id)
|
|
2391
|
+
DELETE FROM "${orm.getEntityByModel(model).tableName}"
|
|
2392
|
+
WHERE "${orm.getEntityByModel(model).tableName}".id = $(id)
|
|
2193
2393
|
`;
|
|
2194
|
-
<span class="cstat-no" title="statement not covered" > return none(query, { id });</span>
|
|
2394
|
+
<span class="cstat-no" title="statement not covered" > return orm.none(query, { id });</span>
|
|
2195
2395
|
};
|
|
2196
2396
|
|
|
2197
2397
|
const deleteMatching = <span class="fstat-no" title="function not covered" ><T</span> extends IModel>(model: T) => {
|
|
2198
2398
|
const { whereClause, values } = <span class="cstat-no" title="statement not covered" >getMatchingParts(model);</span>
|
|
2199
2399
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
2200
|
-
DELETE FROM "${getEntityByModel(model).tableName}"
|
|
2400
|
+
DELETE FROM "${orm.getEntityByModel(model).tableName}"
|
|
2201
2401
|
WHERE ${whereClause};
|
|
2202
2402
|
`;
|
|
2203
|
-
<span class="cstat-no" title="statement not covered" > return none(query, values);</span>
|
|
2403
|
+
<span class="cstat-no" title="statement not covered" > return orm.none(query, values);</span>
|
|
2204
2404
|
};
|
|
2205
2405
|
|
|
2206
2406
|
const getMatching = <span class="fstat-no" title="function not covered" ><T</span> extends IModel>(model: T): T => {
|
|
2207
2407
|
const { whereClause, values } = <span class="cstat-no" title="statement not covered" >getMatchingParts(model);</span>
|
|
2208
2408
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
2209
|
-
SELECT ${getEntityByModel(model).selectColumnsClause}
|
|
2210
|
-
FROM "${getEntityByModel(model).tableName}"
|
|
2409
|
+
SELECT ${orm.getEntityByModel(model).selectColumnsClause}
|
|
2410
|
+
FROM "${orm.getEntityByModel(model).tableName}"
|
|
2211
2411
|
WHERE ${whereClause};
|
|
2212
2412
|
`;
|
|
2213
|
-
<span class="cstat-no" title="statement not covered" > return one<T>(query, values);</span>
|
|
2413
|
+
<span class="cstat-no" title="statement not covered" > return orm.one<T>(query, values);</span>
|
|
2214
2414
|
};
|
|
2215
2415
|
|
|
2216
2416
|
const getOneOrNoneMatching = <span class="fstat-no" title="function not covered" ><T</span> extends IModel>(model: T): T | void => {
|
|
2217
2417
|
const { whereClause, values } = <span class="cstat-no" title="statement not covered" >getMatchingParts(model);</span>
|
|
2218
2418
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
2219
|
-
SELECT ${getEntityByModel(model).selectColumnsClause}
|
|
2220
|
-
FROM "${getEntityByModel(model).tableName}"
|
|
2419
|
+
SELECT ${orm.getEntityByModel(model).selectColumnsClause}
|
|
2420
|
+
FROM "${orm.getEntityByModel(model).tableName}"
|
|
2221
2421
|
WHERE ${whereClause};
|
|
2222
2422
|
`;
|
|
2223
|
-
<span class="cstat-no" title="statement not covered" > return oneOrNone<T>(query, values);</span>
|
|
2423
|
+
<span class="cstat-no" title="statement not covered" > return orm.oneOrNone<T>(query, values);</span>
|
|
2224
2424
|
};
|
|
2225
2425
|
|
|
2226
2426
|
const getAnyMatching = <span class="fstat-no" title="function not covered" ><T</span> extends ICollection<IModel>>(
|
|
@@ -2228,45 +2428,24 @@ export const create = ({
|
|
|
2228
2428
|
): T | void => {
|
|
2229
2429
|
const { whereClause, values } = <span class="cstat-no" title="statement not covered" >getMatchingParts(model);</span>
|
|
2230
2430
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
2231
|
-
SELECT ${getEntityByModel(model).selectColumnsClause}
|
|
2232
|
-
FROM "${getEntityByModel(model).tableName}"
|
|
2431
|
+
SELECT ${orm.getEntityByModel(model).selectColumnsClause}
|
|
2432
|
+
FROM "${orm.getEntityByModel(model).tableName}"
|
|
2233
2433
|
WHERE ${whereClause};
|
|
2234
2434
|
`;
|
|
2235
|
-
<span class="cstat-no" title="statement not covered" > return any<T>(query, values);</span>
|
|
2435
|
+
<span class="cstat-no" title="statement not covered" > return orm.any<T>(query, values);</span>
|
|
2236
2436
|
};
|
|
2237
2437
|
|
|
2238
2438
|
const getAllMatching = <span class="fstat-no" title="function not covered" ><T</span> extends ICollection<IModel>>(model: IModel): T => {
|
|
2239
2439
|
const { whereClause, values } = <span class="cstat-no" title="statement not covered" >getMatchingParts(model);</span>
|
|
2240
2440
|
const query = <span class="cstat-no" title="statement not covered" >`</span>
|
|
2241
|
-
SELECT ${getEntityByModel(model).selectColumnsClause}
|
|
2242
|
-
FROM "${getEntityByModel(model).tableName}"
|
|
2441
|
+
SELECT ${orm.getEntityByModel(model).selectColumnsClause}
|
|
2442
|
+
FROM "${orm.getEntityByModel(model).tableName}"
|
|
2243
2443
|
WHERE ${whereClause};
|
|
2244
2444
|
`;
|
|
2245
|
-
<span class="cstat-no" title="statement not covered" > return many<T>(query, values);</span>
|
|
2445
|
+
<span class="cstat-no" title="statement not covered" > return orm.many<T>(query, values);</span>
|
|
2246
2446
|
};
|
|
2247
2447
|
|
|
2248
|
-
return {
|
|
2249
|
-
// Query Helper Function
|
|
2250
|
-
nestClump,
|
|
2251
|
-
clumpIntoGroups,
|
|
2252
|
-
mapToBos,
|
|
2253
|
-
objectifyDatabaseResult,
|
|
2254
|
-
createFromDatabase,
|
|
2255
|
-
createOneFromDatabase,
|
|
2256
|
-
createOneOrNoneFromDatabase,
|
|
2257
|
-
createManyFromDatabase,
|
|
2258
|
-
getSqlInsertParts,
|
|
2259
|
-
getSqlUpdateParts,
|
|
2260
|
-
getMatchingParts,
|
|
2261
|
-
getMatchingPartsObject,
|
|
2262
|
-
getNewWith,
|
|
2263
|
-
getValueBySqlColumn,
|
|
2264
|
-
// Query Functions
|
|
2265
|
-
one,
|
|
2266
|
-
oneOrNone,
|
|
2267
|
-
many,
|
|
2268
|
-
any,
|
|
2269
|
-
none,
|
|
2448
|
+
return Object.assign({}, orm, {
|
|
2270
2449
|
// Built-in basic CRUD functions
|
|
2271
2450
|
create,
|
|
2272
2451
|
update,
|
|
@@ -2276,16 +2455,14 @@ export const create = ({
|
|
|
2276
2455
|
getOneOrNoneMatching,
|
|
2277
2456
|
getAnyMatching,
|
|
2278
2457
|
getAllMatching,
|
|
2279
|
-
//
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
db
|
|
2288
|
-
};
|
|
2458
|
+
// Helper Utility functions
|
|
2459
|
+
getSqlInsertParts,
|
|
2460
|
+
getSqlUpdateParts,
|
|
2461
|
+
getMatchingParts,
|
|
2462
|
+
getMatchingPartsObject,
|
|
2463
|
+
getNewWith,
|
|
2464
|
+
getValueBySqlColumn
|
|
2465
|
+
});
|
|
2289
2466
|
};
|
|
2290
2467
|
</pre></td></tr>
|
|
2291
2468
|
</table></pre>
|
|
@@ -2293,7 +2470,7 @@ export const create = ({
|
|
|
2293
2470
|
</div><!-- /wrapper -->
|
|
2294
2471
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
2295
2472
|
Code coverage
|
|
2296
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
2473
|
+
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)
|
|
2297
2474
|
</div>
|
|
2298
2475
|
</div>
|
|
2299
2476
|
<script src="../prettify.js"></script>
|