async function getTopicsForSidebar() { try { const res = await db .select({ name: topics.name, parent: topics.parentId }) .from(topics) .leftJoin(topics, eq(topics.id, topics.parentId)) .all() console.log(res) } catch (e) { console.error(e) }}