How to use a composite primary key in WHERE?

I have a table dv360UserProfilesTable which uses a composite key of userId and assignedUserProfileId. If I want to update this table, I'm struggling with how to use the composite key to batch update profiles. The below code throws the error: db error: ERROR: argument of WHERE must be type boolean, not type record

The docs also do not show an example of this https://orm.drizzle.team/docs/indexes-constraints#composite-primary-key

const updatedProfilesResponse = await db
    .update(dv360UserProfilesTable)
    .set({
      status: status,
      lastAuditedAt: new Date(),
      lastAuditedBy: session.user.id.toString(),
    })
    .where(
      or(
        profiles.map((profile: Profile) => {
          return and(
            eq(dv360UserProfilesTable.userId, profile.userId),
            eq(
              dv360UserProfilesTable.assignedUserRoleId,
              profile.assignedUserRoleId
            )
          );
        })
      )
    )
    .returning();
Was this page helpful?