Best way to pass parameters from parent to child table in CloudQuery

What is the best way to pass a parameter down to a child table from a parent table?

Which SDK language are you using?

If you’re using Go, it’s done by having a custom struct wrapping the parent struct and adding the params you’d like to pass (if they’re not on the parent table, that is; they usually are). Then, in the child table, you access the parent struct by doing parent.Item.(yourStruct).

I’ll find you an example from our codebase. Something like this link.

If you don’t want the parent table to include that parameter, you can do a transformers.WithSkipFields to exclude it, or you can just omit that column if you’re defining the table structure manually.

I’m using Golang and right now I’m doing this:

r := parent.Item.(insertStruct)

Sounds like that is the intended method. I wasn’t sure but thank you.

Let us know if you have any more questions :slightly_smiling_face: