selecting all the columns of table join
Hi everyone.
is there a supported syntax to select all the columns of a table join without defining them?
in SQL I use something similar to this:
8 Replies
Hello, @Dush. You can do something like
I appreciate that!
I'm not sure you can do
user: userTable
but there is a utility function you can use which is getTableColumns
I use key: getTableColumns(myTable)
a lot in my code@francis you solution is also good!
user: userTable
works as well btw
oh interesting, I get typescript type errors when I do that
if you want we can try to figure it out
ah, jk, never mind. I figured out my problem. I am using
getTableColumns
at the top level, not nested in an object.
in my case I have table A, that I am joining onto table B, but I don't actually care about any bits of table B in my result - I only am using it for a where filter
so to get only table A I use .select(getTableColumns(tableA))
nice