valtyr/prisma-kysely

Generated Id fields using cuid() as id not marked as Generated<string>

Closed this issue · 1 comments

bazo commented

prisma model is

model User {
  id                  String      @id @default(cuid())
  name                String?
  createdAt           DateTime    @default(now()) @map("created_at")
  updatedAt           DateTime    @updatedAt @map("updated_at")
}

the genereted type is

export type User = {
    id: string;
    name: string | null;
    created_at: Generated<Timestamp>;
    updated_at: Timestamp;
};

but id should be

export type User = {
    id: Generated<string>;
    name: string | null;
    created_at: Generated<Timestamp>;
    updated_at: Timestamp;
};

and probably updatedAt should use Genereted too

and probably updatedAt should use Genereted too

See #59