MySQL (Planetscale): Cannot read properties of undefined (reading 'name')

Hi

Hopefully someone can help me. I'm getting the above error in my insert query.

try {
  const sql = ctx.db.insert(ticketInvitations).values([
    {
      guestId: 1,
      ticketTypeId: '6458eeb763aee9ab82d8b79b',
      eventId: 1,
      amount: 1,
      status: 'pending' as const,
    }
  ]).toSQL();
  console.log(sql);
} catch (error) {
  console.error(error);
}


I have no idea what I'm doing wrong...
Was this page helpful?