Extract type from SubQuery - Drizzle Team