Relational delete with returning

Is there a way to get deleted rows back but also selecting relations?

Right now we have:
  const results = await db.query.scheduledCalls.findMany({
    limit,
    offset,
    where: eq(scheduledCalls.queueName, queueName),
    with: {
      lead: true,
    },
  });


But we want to do with the delete() and returning()
Was this page helpful?