Migrating from Prisma client to Kysely issue

I am evaluating various aspects of changing from Prisma client to Kysely but i seem to have hit a small snag

basic tutorial i followed was from nexxel https://www.nexxel.dev/blog/typesafe-database

in my prisma schema i have
model Recipe {
  id           String   @id @default(cuid())
  name         String
  prepTime     String
  cookTime     String
  totalTime    String
  servings     String?
  description  String?
  ingredients  Json     @default("[]")
  instructions Json     @default("[]")
  updatedAt    DateTime @updatedAt
}


in prisma i was able to do this
    return await ctx.prisma.recipe.create({
        data: {
          name: input.name,
          description: input.description,
          ingredients: input.ingredients.split('\n'),
          instructions: input.instructions.split('\n'),
          prepTime: input.prepTime,
          cookTime: input.cookTime,
          totalTime: input.totalTime,
          servings: input.servings,
        },
      })


but in Kysely its forcing me to add id and updated at otherwise it overloads saying it needs id and updatedAt

return await db.insertInto('Recipe').values({
        id: '342432', // how do i handle this autogenrating this from the DB?
        updatedAt: new Date(), // how do i handle this autogenrating this from the DB?
        name: input.name,
        description: input.description,
        ingredients: input.ingredients.split('\n'),
        instructions: input.instructions.split('\n'),
        prepTime: input.prepTime,
        cookTime: input.cookTime,
        totalTime: input.totalTime,
        servings: input.servings,
      }).executeTakeFirst()


I tried reading the kysely documentation but couldnt find it personally
Was this page helpful?