Skip to content

Conversation

@bajtos
Copy link
Member

@bajtos bajtos commented Aug 3, 2020

Add support for the following variants:

  • execute(collection, command, ...params, options) (MongoDB)
  • execute(...params) (forward-compatibility & other databases)

This is a follow-up for #1855, which added type descriptions for execute variants that turned out to be rejected by the actual (runtime) implementation. See also loopbackio/loopback-next#3342

The changes is pushing the responsibility for processing optional arguments ((cmd), (cmd, args), (cmd, args, options)) to the connector. This should be fine because the base SqlConnector already handles optional arguments (see lib/sql.js#L551-L563), and we weren't really supporting non-SQL execute before.

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • Commit messages are following our guidelines

@bajtos bajtos added the feature label Aug 3, 2020
@bajtos bajtos requested a review from jannyHou August 3, 2020 12:52
@bajtos bajtos self-assigned this Aug 3, 2020
Implement support for the following variants:

- `execute(collection, command, ...params, options)` (MongoDB)
- `execute(...params)` (forward-compatibility & other databases)

Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
@bajtos bajtos force-pushed the feat/execute-db-command branch from 8570233 to c884c62 Compare August 3, 2020 13:01
@bajtos
Copy link
Member Author

bajtos commented Aug 3, 2020

coverage/coveralls — Coverage decreased (-0.0005%) to 84.722%

I believe this is caused by reducing the number of lines in lib/datasource.js - i.e. the number of lines executed by our tests is staying the same, but the total number of lines is lower now, therefore the coverage ratio went slightly down. Nothing to worry about.

Copy link
Contributor

@jannyHou jannyHou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@bajtos bajtos merged commit dd23a14 into master Aug 4, 2020
@bajtos bajtos deleted the feat/execute-db-command branch August 4, 2020 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants