-
Notifications
You must be signed in to change notification settings - Fork 24
fix: Relax plugin tables and columns validation #1203
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
fix: Relax plugin tables and columns validation #1203
Conversation
28ac73f to
fcf44ea
Compare
| return nil | ||
| } | ||
|
|
||
| func (t *Table) ValidateName() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also a function to validate column names, but I kept it due to
plugin-sdk/transformers/struct.go
Line 370 in 3dbf2e9
| if nameFromJSONTag := defaultCaser.ToSnake(jsonTag); schema.ValidColumnName(nameFromJSONTag) { |
hermanschaaf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should definitely remove this from plugin initialization, but maybe let's create a ticket to do this kind of validation as part of the source plugin test suite? These checks can then be opt-in by default.
Yeah, but should we test it on the source? I mean destinations have the restrictions on names, not sources, so how would the source know what to restrict? |
🤖 I have created a release *beep* *boop* --- ## [4.7.1](v4.7.0...v4.7.1) (2023-09-05) ### Bug Fixes * Relax plugin tables and columns validation ([#1203](#1203)) ([59c3715](59c3715)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
|
Opened cloudquery/cloudquery#14587 |
Summary
Follow up to #1108. This PR relaxes the validation to check only for duplicates.
Some databases allow uppercase table names and the validation in the SDK seemed to be PostgreSQL oriented.
At some point we might want to have destination specific validation/normalization.
Related to https://discord.com/channels/872925471417962546/873606591335759872/1148643989348679770
Use the following steps to ensure your PR is ready to be reviewed
go fmtto format your code 🖊golangci-lint run🚨 (install golangci-lint here)