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

Added "mode" option for crud select operation #416

Merged
merged 2 commits into from
Sep 6, 2023
Merged

Added "mode" option for crud select operation #416

merged 2 commits into from
Sep 6, 2023

Conversation

nickkkccc
Copy link
Contributor

@nickkkccc nickkkccc commented Sep 5, 2023

I haven't forgotten about:

  • Tests
  • Changelog
  • Documentation
  • Commit messages comply with the guideline
  • Cleanup the code for review. See checklist

Related issues:
Closes #107

@nickkkccc nickkkccc linked an issue Sep 5, 2023 that may be closed by this pull request
@nickkkccc nickkkccc requested a review from ArtDu September 5, 2023 13:27
Copy link
Contributor

@ArtDu ArtDu left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Great job, I left only two small comments

CHANGELOG.md Show resolved Hide resolved
* @return this options instance.
*/
default T withMode(String mode) {
if (!mode.equals("read") && !mode.equals("write")) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: You can use enum because modes are determined values. It's up to you

Copy link
Collaborator

Choose a reason for hiding this comment

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

I suggest using enums. This check will look better then. Also, the users will benefit from using the enum values that are better supported by autocompletion in editors.

Copy link
Collaborator

@akudiyar akudiyar Sep 5, 2023

Choose a reason for hiding this comment

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

Also I do not like the initial naming, it's rather strange. We may think about using something more widely used in the industry, like leader/replica, otherwise the meaning is very obscure (my first thought was "is select writing anything?!")

Copy link
Contributor

Choose a reason for hiding this comment

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

Also I do not like the initial naming, it's rather strange. We may think about using something more widely used in the industry, like leader/replica, otherwise the meaning is very obscure (my first thought was "is select writing anything?!")

It should have been renamed in crud/vshard. If we changed it in connector it would be confusuing thing for users who wants to understand how tarantool and ecosystem works. Let it be unified

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. Done.

Copy link
Collaborator

@akudiyar akudiyar left a comment

Choose a reason for hiding this comment

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

Looks good, I have two suggestions BTW

* @return this options instance.
*/
default T withMode(String mode) {
if (!mode.equals("read") && !mode.equals("write")) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suggest using enums. This check will look better then. Also, the users will benefit from using the enum values that are better supported by autocompletion in editors.

* @return this options instance.
*/
default T withMode(String mode) {
if (!mode.equals("read") && !mode.equals("write")) {
Copy link
Collaborator

@akudiyar akudiyar Sep 5, 2023

Choose a reason for hiding this comment

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

Also I do not like the initial naming, it's rather strange. We may think about using something more widely used in the industry, like leader/replica, otherwise the meaning is very obscure (my first thought was "is select writing anything?!")

@ArtDu ArtDu merged commit cd1b3fb into master Sep 6, 2023
3 checks passed
@ArtDu ArtDu deleted the gh-107 branch September 6, 2023 10:02
@nickkkccc nickkkccc self-assigned this Sep 13, 2023
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.

Implement API to pass 'mode=write' parameter to CRUD library
3 participants