cloudquery / cq-provider-sdk

CloudQuery Provider SDK enables building providers to query any service or custom in-house solutions with SQL
https://cloudquery.io
Mozilla Public License 2.0
8 stars 15 forks source link

Allow custom field to be used for relation #19

Open bombergio opened 3 years ago

bombergio commented 3 years ago

Currently, only the id field is allowed to be used for the relation. That would generate unnecessary fields where relation could be made by the already present field. Example: Type Volume and Volume Attachment. Volume attachment have field VolumeId, but it could not be used to for the relation mapping.

roneli commented 3 years ago

Sorry for the late reply, see related https://github.com/cloudquery/cq-provider-aws/issues/62

We are currently working on this problem.

One solution to reduce multiple ids is to allow the user define the tables "id or ids" if not we will auto generate one i.e volume_id column will be id = true.

This will remove unnecessary fields and will allow the provider's id to be used instead of a generated one also making queries more simpler.