omar-dulaimi / prisma-trpc-generator

Prisma 2+ generator to emit fully implemented tRPC routers
MIT License
676 stars 34 forks source link

Mongodb raw queries operations and schemas are not getting generated #29

Closed HananoshikaYomaru closed 2 years ago

HananoshikaYomaru commented 2 years ago

image I think some router are generating some undefined operation. Why does this happens?

My schema is something like this:

// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

model Account {
  id                 String  @id @default(auto()) @map("_id") @db.ObjectId
  userId             String  @map("user_id")
  type               String
  provider           String
  providerAccountId  String  @map("provider_account_id")
  refresh_token      String? @db.String
  access_token       String? @db.String
  expires_at         Int?
  token_type         String?
  scope              String?
  id_token           String? @db.String
  session_state      String?

  user User @relation(fields: [userId], references: [id], onDelete: Cascade)

  @@unique([provider, providerAccountId])
  @@map("accounts")
}

model Session {
  id           String   @id @default(auto()) @map("_id") @db.ObjectId
  sessionToken String   @unique @map("session_token")
  userId       String   @map("user_id")
  expires      DateTime
  user         User     @relation(fields: [userId], references: [id], onDelete: Cascade)

  @@map("sessions")
}

model User {
  id            String    @id @default(auto()) @map("_id") @db.ObjectId
  name          String?
  email         String?   @unique
  emailVerified DateTime? @map("email_verified")
  image         String?
  accounts      Account[]
  sessions      Session[]

  @@map("users")
}

model VerificationToken {
  id         String @id @default(auto()) @map("_id") @db.ObjectId
  identifier String
  token      String   @unique
  expires    DateTime

  @@unique([identifier, token])
  @@map("verification_tokens")
}
omar-dulaimi commented 2 years ago

Should be fixed in https://github.com/omar-dulaimi/prisma-trpc-generator/releases/tag/0.4.3