INSERT/UPDATE Strict Models Enhancements #85
Labels
No labels
bug
confirmed
critical
discussion
documentation
Doing
enhancement
suggestion
support
To Do
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: hazaar/hazaar-dbi#85
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Using strict models is a good way to normalise data on it's way to the database. Currently it is possible to pass a
Model\Strict
object to DBI and it will extract the data into a field object to send to the driver, all automatically.What it doesn't do automatically, is to do with fields that have a default value. Currently for these fields I would set
dbi: false
so that DBI does not send them. This is fine for an INSERT if I want the database server to create the value. But with an update, we might want to update a value.What I propose is, if possible, we can do away with
dbi: false
in the strict model field definition and get INSERT to check the column metadata for any field values that are NULL. This should allow the INSERT to succeed because the actual SQL field will not include the NULL values, but at the same time allow UPDATES to succeed because we are no longer disabling DBI on these fields.assigned to @jamie
created branch
85-insert-update-strict-models-enhancements
to address this issuementioned in merge request !54