You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c0ef372
Browse filesBrowse the repository at this point in the historyBrowse files
feat: add strict field protection for Models (#10302)
* feat(model): add strict field protection
Add an opt-in Model setting that throws when write data contains fields
that would otherwise be discarded by allowed field protection.
- Add $strictFieldProtection and strictFieldProtection()
- Throw DataException for disallowed write fields in strict mode
- Preserve existing primary key and updateBatch index behavior
- Cover insert, save, update, batch, validation order, and protect(false)
- Document the new option and update the model generator template
Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
* test: avoid SQLSRV identity update in strict protection test
Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
* refactor: rename disallowed field exception mode
Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
* fix: restore validation state on insert batch exception
Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
---------
Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
0 commit comments