Custom `Select` object returns type `any`

Databases like Planetscale do not support FK constraints. As I understand I can manipulate the returned data structure from within the select clause.

The data structure returned is correct but there is a typescript error casting it to any. Is there a way to fix this or am I misusing select?

  const [event] = await db
      createdBy: {
    .innerJoin(users, eq(events.createdByUserId,

export const events = mysqlTable("events", {
  id: cuid2("id").primaryKey().notNull(),
  name: text("name").notNull(),
  description: text("description"),
  image: text("image").notNull(),
  privacy: text("privacy", { enum: ["public", "private"] }).notNull(),
  startDate: timestamp("startDate").notNull(),
  endDate: timestamp("endDate").notNull(),
  createdByUserId: cuid2("created_by_user_id").notNull(),
  created_at: timestamp("created_at").notNull().defaultNow(),
  updated_at: timestamp("updated_at").notNull().defaultNow().onUpdateNow()