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

add transformers #68

Merged
merged 6 commits into from
Sep 7, 2023
Merged

add transformers #68

merged 6 commits into from
Sep 7, 2023

Conversation

alishakawaguchi
Copy link
Contributor

added operator transformers to api. starting with a small subset

@@ -1,7 +1,6 @@
# `buf format -w` writes to each file, so causes tilt to loop. instead we instruct buf
# to just output the changes in diff format and apply those.
BUF_VERSION=$(cat BUF_VERSION)
SQLC_VERSION=$(cat SQLC_VERSION)
Copy link
Member

Choose a reason for hiding this comment

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

rip

@@ -44,7 +44,8 @@ func (s *Service) GetConnectionSchema(

conn, err := pgx.Connect(ctx, connectionString)
if err != nil {
return connect.NewResponse(&mgmtv1alpha1.GetConnectionSchemaResponse{}), nil
logger.Error("unable to connect")
Copy link
Member

Choose a reason for hiding this comment

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

are you intentionally not logging the error itself here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope forgot

if column.Transformer != nil {
name, err := getTransformerName(column.Transformer.Name)
if err != nil {
transformerName = "unspecified"
Copy link
Member

Choose a reason for hiding this comment

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

why unspecified instead of passthrough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm I thought passthrough was only if the transformer was empty. I guess my thought process was there is potentially a transformer defined or set on the CRD but not through the UI. In that case it's not really passthrough but not supported by the frontend either

string transformer = 5 [(validate.rules).string = {
in: [
"passthrough",
"uuidV4"
Copy link
Member

Choose a reason for hiding this comment

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

I see uuidV4 here but in other spots uuid_v4
curious why the difference?

Copy link
Member

Choose a reason for hiding this comment

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

also this list seems to be different from the transformers package in k8s-operator? which also is only a subset of what is currently defined. planning to continue filling that out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops yep meant to update that but forgot. I plan to continue filling it out

@alishakawaguchi alishakawaguchi merged commit 0e8b47d into main Sep 7, 2023
7 checks passed
@alishakawaguchi alishakawaguchi deleted the alisha/transformation-map branch September 7, 2023 17:00
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.

2 participants