creating external types based on drizzle types

hey I'm trying to abstract some of my drizzle calls into seperate functions to refactor my code. How would I go about getting the type that my .values() enforces on the current table and replacing my data: any with that?

export async function createInvite(data: any) {
  const invite = await db
    .insert(data)
    .values({
      ...data
    })
    .returning({ inviteId: data.id });

  return invite;
}
Was this page helpful?