help with drizzle types not inferred well

async function addTopic(topic: string, content: string, parent?: string) {
  try {
    let parentId: number | null = null
    await db.transaction(async (tx) => {
      await tx
        .select({ id: topics.id })
        .from(topics)
        .where({ name: topic, ownerId: 1 })
        .all()
    })
Was this page helpful?