Skip to content

Subsume waitForCompletion/updateDBKeyspace into BlockingCommandOptions#134

Merged
sl-at-ibm merged 3 commits intomainfrom
SL-issue127-CreateDatabase_parameters
Apr 15, 2026
Merged

Subsume waitForCompletion/updateDBKeyspace into BlockingCommandOptions#134
sl-at-ibm merged 3 commits intomainfrom
SL-issue127-CreateDatabase_parameters

Conversation

@sl-at-ibm
Copy link
Copy Markdown
Collaborator

@sl-at-ibm sl-at-ibm commented Apr 13, 2026

Fixes #127 .
More specifically, this PR solves the issue of multiple/opaque bool params to {Create/Drop} x {Database/Keyspace}.

  • a subclass BlockingCommandOptions of CommandOptions, used in those methods
  • which contains a waitForCompletion boolean (defaulting to true)
  • Moreover: reordered (the remaining) implementations for uniformity
  • Moreover: breaking change brought the "replication options" at the end of the signature for HCD's CreateKeyspace for uniformity
  • Moreover: rephrase/rearrange xmldocs (use "inheritfrom", improve param description, presence/absence of code examples and such)
  • Moreover: DropDatabase is not a bool anymore, rather a void, as its semantics would (also DropKeyspace and other clients work like that) (slight) breaking change
  • (Some tests renamed and slightly reformulated, also some comments therein)

[the following part outdated, see further posts]
Now I did not subsume updateDbKeyspace into these options... yet. I am not 100% sure this should be done at all:

  1. it's only one boolean (still 'opaque', but just one)
  2. Its meaning is not really that of "an option that controls request execution" to be strict (like the rest of BlockingCommandOptions is)
  3. keeping it top-level saves the quick, easy HCD one-liner "create keyspace and have the DB set to use it". Otherwise it would get a tad more verbose.

@toptobes any opinion?

@sl-at-ibm sl-at-ibm requested a review from toptobes April 13, 2026 14:49
@sl-at-ibm
Copy link
Copy Markdown
Collaborator Author

@a-random-steve FYI

@sl-at-ibm sl-at-ibm force-pushed the SL-issue127-CreateDatabase_parameters branch from e16432a to 388a464 Compare April 14, 2026 09:10
@sl-at-ibm
Copy link
Copy Markdown
Collaborator Author

Note for posterity. Considering the fact that you can anonymously instantiate in the argument (i.e. new() {...} without class name explicitly), and hence the HCD create-and-use-keyspace pattern stays rather terse, it was decided to subsume updateDbKeyspace as well. Which I'm going as a follow-up in this branch - stay tuned.

@sl-at-ibm
Copy link
Copy Markdown
Collaborator Author

And here we go with the updateDBKeyspace gone into the options as well.

@skedwards88 breaking change. Please note that the "HCD create-and-use" pattern remains short, as exemplified in DatabaseAdminAstra_CreateKeyspaceAsync_Update by the idiom:

await daa.CreateKeyspaceAsync(keyspaceName, new () {updateDBKeyspace = true});

@sl-at-ibm sl-at-ibm changed the title Subsume waitForCompletion into BlockingCommandOptions Subsume waitForCompletion/updateDBKeyspace into BlockingCommandOptions Apr 15, 2026
@sl-at-ibm sl-at-ibm added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit c39c785 Apr 15, 2026
7 checks passed
@sl-at-ibm sl-at-ibm deleted the SL-issue127-CreateDatabase_parameters branch April 15, 2026 19:51
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.

Avoid two booleans in a row for CreateDatabase signature

2 participants