Updated Modifiers (markdown)

Vinícius Garcia 2022-12-04 17:50:09 -03:00
parent 9c9b4a8f5f
commit 4f35935d1d

@ -26,7 +26,7 @@ Modifiers improve on the `Valuer`/`Scanner` feature provided by the standard lib
- `json`: It will convert any type to JSON before writing to the database and unmarshal it back from JSON when reading, this makes it
easy to save structs as JSON in the database if this fits your use-case.
- `timeNowUTC`: It only works on attributes of type `time.Time` and it sets this attribute to `time.Now().UTC()` every time before insertions and updates. This modifier was created to be used on `UpdatedAt` timestamp fields.
- `timeNowUTC`: This one works on attributes of type `time.Time` by setting its value to `time.Now().UTC()` every time before insertions and updates. This modifier was created to be used on `UpdatedAt` timestamp fields.
- `timeNowUTC/skipUpdates`: Does the same as the above but only on insertions, during Updates attributes marked with this modifier will be completely ignored. This is useful for `CreatedAt` fields where you only want them to be set once when first creating the record.
- `skipUpdates`: Will ignore fields on updates.
- `skipInserts`: Will ignore fields on inserts.