Title
a

Arun Kumar

06/22/2021, 12:50 PM
+   id: Int
  }
}

Argument id for data.id is missing.
r

Ryan

06/22/2021, 12:51 PM
Does it have a default value? If not then you need to provide the value.
a

Arun Kumar

06/22/2021, 12:53 PM
here is the schema
id Int @id
@Ryan It's a primary key and I want it be auto generated when I create an entry
r

Ryan

06/22/2021, 12:57 PM
So it should be:
id Int @id @default(autoincrement())
a

Arun Kumar

06/22/2021, 12:59 PM
Yes. Thanks. I'm using pg admin to create the fields and doing introspect to fetch the schema
r

Ryan

06/22/2021, 1:00 PM
Then what did you write in PgAdmin? Could you share the SQL?
If you have set it as autoincrement then it should show it as that after introspection.
a

Arun Kumar

06/22/2021, 1:02 PM
Yes. Forgot to set the identity constraint
Now this is working as expected
đŸ’¯ 1