Skip to content

Conversation

@erezrokah
Copy link
Member

@erezrokah erezrokah commented Sep 5, 2023

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

  • Read the contribution guidelines 🧑‍🎓
  • Run go fmt to format your code 🖊
  • Lint your changes via golangci-lint run 🚨 (install golangci-lint here)
  • Update or add tests 🧪
  • Ensure the status checks below are successful ✅

@erezrokah erezrokah force-pushed the fix/relax_plugin_validation branch from 28ac73f to fcf44ea Compare September 5, 2023 16:07
return nil
}

func (t *Table) ValidateName() error {
Copy link
Member Author

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

if nameFromJSONTag := defaultCaser.ToSnake(jsonTag); schema.ValidColumnName(nameFromJSONTag) {

Copy link
Member

@hermanschaaf hermanschaaf left a 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.

@github-actions
Copy link

github-actions bot commented Sep 5, 2023

⏱️ Benchmark results

Comparing with 3dbf2e9

  • Glob-8 ns/op: 99.09 ⬇️ 0.45% decrease vs. 3dbf2e9

@kodiakhq kodiakhq bot merged commit 59c3715 into cloudquery:main Sep 5, 2023
@erezrokah erezrokah deleted the fix/relax_plugin_validation branch September 5, 2023 16:16
@erezrokah
Copy link
Member Author

but maybe let's create a ticket to do this kind of validation as part of the source plugin test suite

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?

@github-actions github-actions bot added fix and removed fix labels Sep 5, 2023
erezrokah pushed a commit that referenced this pull request Sep 5, 2023
🤖 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).
@erezrokah
Copy link
Member Author

Opened cloudquery/cloudquery#14587

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants