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?

await db
    .select({
      customerFileId: customer_file.id,
      referenceId: customer_file.reference_id,
      state: customer_file.state,
      backwardStates: customer_file.backward_states,
      forwardStates: customer_file.forward_states,
      cancelStates: customer_file.cancel_states,
      dateCreated: customer_file.date_created,
      // All comulns from user table
    })
    .from(customer_file)
    .innerJoin(user, eq(customer_file.owner_id, user.id))
    .where(and(eq(customer_file.id, customer_file_id), sql`${customer_file.date_created} > NOW() - INTERVAL '10 days'`))


in SQL I use something similar to this:

SELECT cf.id, cf.reference_id, cf.state, cf.backward_states, cf.forward_states, cf.cancel_states, cf.date_created, u.*
FROM iziflow.customer_file cf
JOIN iziflow.user u ON cf.owner_id = u.id
Was this page helpful?