loopback-datasource-juggler icon indicating copy to clipboard operation
loopback-datasource-juggler copied to clipboard

feat: add capability for insert multiple rows in single query

Open samarpanB opened this issue 2 years ago • 4 comments

Signed-off-by: Samarpan Bhattacharya [email protected]

Adds new createAll method to support insert multiple rows in single query in memory connector Enables multiInsertSupport in memory connector Adds capability to createAll in dao.js for models to do multiple insert in one query via the supported connectors

Fixes https://github.com/loopbackio/loopback-connector/issues/227 See also https://github.com/loopbackio/loopback-next/issues/3357

Checklist

  • [x] Sign off your commits with DCO (Developer Certificate of Origin)
  • [x] npm test passes on your machine
  • [x] New tests added or existing tests modified to cover all changes
  • [x] Code conforms with the style guide
  • [x] Commit messages are following our guidelines

samarpanB avatar Sep 15 '22 11:09 samarpanB

Pull Request Test Coverage Report for Build 3167967406

  • 91 of 106 (85.85%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.09%) to 84.667%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/connectors/memory.js 11 13 84.62%
lib/dao.js 80 93 86.02%
<!-- Total: 91 106
Totals Coverage Status
Change from base Build 3155109076: -0.09%
Covered Lines: 7250
Relevant Lines: 8255

💛 - Coveralls

coveralls avatar Sep 15 '22 13:09 coveralls

Added persistence hooks test cases as well. While adding those, I found some issues, fixed them as well. Please review @dhmlau @achrinza

samarpanB avatar Sep 25 '22 16:09 samarpanB

loopback-connector release is needed before it can be merged. However, this can be reviewed until then.

samarpanB avatar Sep 25 '22 19:09 samarpanB

Updated connector version after rebase.

samarpanB avatar Oct 02 '22 08:10 samarpanB

@raymondfeng @achrinza @dhmlau Please review.

samarpanB avatar Oct 20 '22 10:10 samarpanB

@dhmlau I replied to your comment. Can you please check if I need to change the behaviour ?

samarpanB avatar Oct 25 '22 08:10 samarpanB

@samarpanB, thanks for your response. LGTM. Since I have the "go ahead" from @achrinza as well, I'll be merging this PR. Thanks!

dhmlau avatar Nov 01 '22 19:11 dhmlau