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

feat: APIs for Backend Changes for Default Values #965

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

asthamohta
Copy link
Collaborator

The following PR contains APIs which will be used for Default Value migrations. For completeness on usage of these API, refer to the following PR: #952

@asthamohta asthamohta marked this pull request as ready for review December 17, 2024 16:37
@asthamohta asthamohta requested a review from a team as a code owner December 17, 2024 16:37
@asthamohta asthamohta requested review from darshan-sj and Deep1998 and removed request for a team December 17, 2024 16:37
@asthamohta asthamohta changed the title feat: APIs for Backend Changes feat: APIs for Backend Changes for Default Values Dec 17, 2024
Copy link
Collaborator

@darshan-sj darshan-sj left a comment

Choose a reason for hiding this comment

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

Left few comments.
Good work covering most of the methods with Unit tests!

conversion/conversion_from_source.go Show resolved Hide resolved
sources/common/toddl.go Show resolved Hide resolved
sources/common/toddl.go Outdated Show resolved Hide resolved
sources/common/toddl.go Show resolved Hide resolved
webv2/table/utilities.go Show resolved Hide resolved
expressions_api/expression_verify.go Show resolved Hide resolved
expressions_api/expression_verify.go Show resolved Hide resolved
expressions_api/expression_verify.go Show resolved Hide resolved
Copy link
Collaborator

@darshan-sj darshan-sj left a comment

Choose a reason for hiding this comment

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

LGTM

webv2/table/utilities.go Show resolved Hide resolved
sources/common/toddl.go Outdated Show resolved Hide resolved
return nil, err
}
} else {
spannerAccessor, err = spanneraccessor.NewSpannerAccessorClientImpl(ctx)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Dont have full context but Why are we multiplexing this here? Seems like this project id based if else logic should reside inside NewSpannerAccessorClientImpl() that creates accessor without spanner client if fields are empty.

}
return &ExpressionVerificationAccessorImpl{
SpannerAccessor: spannerAccessor,
}, nil
}

type DDLVerifier interface {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: in general its good practice to document behaviour for methods in interface.

@@ -79,6 +107,15 @@ func (ev *ExpressionVerificationAccessorImpl) VerifyExpressions(ctx context.Cont
return verifyExpressionsOutput
}

func (ev *ExpressionVerificationAccessorImpl) RefreshSpannerClient(ctx context.Context, project string, instance string) error {
spannerClient, err := spannerclient.NewSpannerClientImpl(ctx, fmt.Sprintf("projects/%s/instances/%s/databases/%s", project, instance, "smt-staging-db"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

"smt-staging-db" should be a constant string across the codebase.

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