Skip to content

feat(transformers): Add WithPrimaryKeys option#598

Merged
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
erezrokah:feat/with_pks
Jan 11, 2023
Merged

feat(transformers): Add WithPrimaryKeys option#598
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
erezrokah:feat/with_pks

Conversation

@erezrokah
Copy link
Copy Markdown
Member

Summary

Adds WithPrimaryKeys so we don't need to define extra columns just for the sake of primary keys.
The issue with extra columns is that you need to manually configure the column name resolver and type. It's easy to miss those especially when plugins have custom logic for resolvers and types, for example:
https://github.com/cloudquery/cloudquery/blob/cb9b4f85ccb82f850e6ded6c19a39d06c4f2c94a/plugins/source/gcp/client/transformers.go#L17
https://github.com/cloudquery/cloudquery/blob/cb9b4f85ccb82f850e6ded6c19a39d06c4f2c94a/plugins/source/gcp/client/transformers.go#L39
https://github.com/cloudquery/cloudquery/blob/cb9b4f85ccb82f850e6ded6c19a39d06c4f2c94a/plugins/source/gcp/client/transformers.go#L54


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 ✅

@github-actions
Copy link
Copy Markdown

⏱️ Benchmark results

Comparing with 506d4cc

  • DefaultConcurrencyDFS-2 resources/s: 9,952 ⬇️ 10.35% decrease vs. 506d4cc
  • DefaultConcurrencyRoundRobin-2 resources/s: 11,213 ⬆️ 2.60% increase vs. 506d4cc
  • Glob-2 ns/op: 214.7 ⬆️ 11.36% increase vs. 506d4cc
  • TablesWithChildrenDFS-2 resources/s: 24,694 ⬇️ 1.68% decrease vs. 506d4cc
  • TablesWithChildrenRoundRobin-2 resources/s: 24,811 ⬇️ 9.10% decrease vs. 506d4cc
  • TablesWithRateLimitingDFS-2 resources/s: 28.22 ⬇️ 0.39% decrease vs. 506d4cc
  • TablesWithRateLimitingRoundRobin-2 resources/s: 814.5 ⬇️ 1.10% decrease vs. 506d4cc
  • BufferedScanner-2 ns/op: 13.14 ⬆️ 7.76% increase vs. 506d4cc
  • LogReader-2 ns/op: 38.37 ⬆️ 9.85% increase vs. 506d4cc

Copy link
Copy Markdown
Contributor

@yevgenypats yevgenypats left a comment

Choose a reason for hiding this comment

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

Nice. cc @disq (I know you were also waiting for this) :)

@kodiakhq kodiakhq bot merged commit 107006c into cloudquery:main Jan 11, 2023
kodiakhq bot pushed a commit that referenced this pull request Jan 12, 2023
🤖 I have created a release *beep* *boop*
---


## [1.25.0](v1.24.2...v1.25.0) (2023-01-11)


### Features

* **docs:** Sort tables ([#599](#599)) ([8a3bfad](8a3bfad))
* **transformers:** Add support for `net.IP` ([#595](#595)) ([a420645](a420645))
* **transformers:** Add WithPrimaryKeys option ([#598](#598)) ([107006c](107006c))


### Bug Fixes

* Send resource validation errors to Sentry ([#601](#601)) ([5916516](5916516))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.

2 participants