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 ValidatableCommandClause POC #1309

Merged
merged 2 commits into from
Jul 29, 2024
Merged

Added ValidatableCommandClause POC #1309

merged 2 commits into from
Jul 29, 2024

Conversation

amorton
Copy link
Contributor

@amorton amorton commented Jul 25, 2024

What this PR does:
Encapsulates behaviour for clauses that can be validated and better supports schema object types.

This is a POC for adding this, just to the level needed to make table code work.

I will create a ticket to centralize all of the validation, based on this approach, and add here.

See #1310

NOTE : THIS PR DOES NOT CLOSE THE ISSUE ABOVE ^^^^

Which issue(s) this PR fixes:
Fixes #

Checklist

  • [*] Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • [*] CLA Signed: DataStax CLA

Encapsulates behavior for clauses that can be validated and
better supports schema object types.
*/
static <T extends SchemaObject> void maybeValidate(
CommandContext<T> commandContext, ValidatableCommandClause validatable) {
if (validatable == null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is null legal? Assumption being that missing Clause is always valid thing?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, I think so.

Copy link
Contributor

@tatu-at-datastax tatu-at-datastax left a comment

Choose a reason for hiding this comment

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

Ok, I have some questions about the big picture, but details are fine. We can go back and consider this -- approving since it's a pre-req for other changes.

@Yuqi-Du
Copy link
Contributor

Yuqi-Du commented Jul 29, 2024

Reviewed, approach is clear.
+1 that we may need to make some exceptions, since not every validation is easy to do or good to do in the resolver level.

@Yuqi-Du Yuqi-Du merged commit d88b3ac into main Jul 29, 2024
3 checks passed
@Yuqi-Du Yuqi-Du deleted the ajm/validate-poc branch July 29, 2024 22:10
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.

3 participants