Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: update findOne and deleteAll semantics #244

Merged
merged 9 commits into from
Jun 2, 2024

Conversation

Josuto
Copy link
Owner

@Josuto Josuto commented Jun 1, 2024

What is the purpose of this pull request?

Put an "X" next to item:

[ ] Documentation update
[ ] Bug fix
[ ] New feature
[x] Other, please explain: Change on operation semantics

What changes did you make?

Updated the semantics of findOne and deleteAll, so that in the absence of the filters property in the options parameter, these operations find an arbitrary entity and delete all existing entities, respectively. These changes are motivated by the semantics of counterpart operations in Mongoose. Furthermore, we want the signatures of these operations to convey with others e.g., findAll specify filters as part of its options optional parameter.

Moreover, we also removed connection from TransactionOptions, since it is no longer of use to any CRUD operation specified at any abstract repository implementation. It is however kept for the only function requiring it: runInTransaction.

Which issue (if any) does this pull request address?

Is there anything you'd like reviewers to focus on?

Also modified ESLint config.
Also unpublish some domain model types to avoid API maintenance responsibilties.
The option connection is of no longer use in CRUD operations; only in runInTransaction.
This operation now returns an arbitrary existing entity (if any)
FindAllOptions.sortBy and filters attribute from FindOneOptions, FindAllOptions, and DeleteAllOptions used to be of type 'any' . Now devs will experience TS errors when they do not provide valid values.
@Josuto Josuto changed the base branch from main to canary June 2, 2024 12:03
@Josuto Josuto merged commit 1e2170c into canary Jun 2, 2024
6 of 10 checks passed
@Josuto Josuto deleted the update_find_one_and_delete_all_semantics branch June 2, 2024 12:16
@Josuto Josuto changed the title Update findOne and deleteAll semantics fix!: update findOne and deleteAll semantics Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant