Closed ablygo closed 2 years ago
Yes, thanks for prompting this. Indeed readOnly
is completely broken for any writes. I should display a more prominent warning.
Thanks again for flagging this up. The next version I release will informally deprecated readOnlyTableField
. It just shouldn't be used.
So I was trying to update some rows in a database and kept getting a foreign key constraint violation, and changing the primary row from
readOnly
tooptional
and changing my update function fromto
fixed the issue. However, I ended up noticing a
createdTime
field that was also readOnly and didn't have a foreign key constraint was getting modified by the update, and found the discussion in #447. Given the behaviour I'm seeing, and the explanation there, I feel like it must also apply to readOnly fields, but neither the documentation forUpdate
orreadOnlyTableFields
mention that.I don't know if that's intended, or if I've somehow done something wrong, because the name readOnly seems extremely counterintuitive if it is (it would seem to imply there's no way to update the field without the field being modified). If it is then the documentation for
Update
andreadOnlyTableFields
should probably mention it.