From Prisma Model to Kysely Schema

Hey everyone, I'm using this package https://github.com/valtyr/prisma-kysely, the output of this Prisma Model
model Business {
  id           String         @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid 
  email        String
  name         String         @db.VarChar(100)
  phone        String
  description  String?
  bannerUrl    String?
  address      Address        @relation(fields: [addressId], references: [id])
  addressId    String         @unique @db.Uuid
  workingHours WorkingHours?
  services     Service[]
  businessType BusinessType[]
  appointments Appointment[]
  user         User           @relation(fields: [userId], references: [id])
  userId       String         @unique @db.Uuid
}
is
export type Business = {
    id: Generated<string>;
    email: string;
    name: string;
    phone: string;
    description: string | null;
    bannerUrl: string | null;
    addressId: string;
    userId: string;
};

so when I have Kysely code such as
const business = await db
  .insertInto('Business')
  .values({
    email: `business${i}@example.com`
    name: `businessName${i}`,
    phone: `phone${i}`,
    userId: user[0].id,
    addressId: address[0].id, 
    businessType: businessType[0].id // gives error because it's not in the `schema.d.ts` file
            })
  .returning('Business.id')
  .execute();
Was this page helpful?