diff --git a/Modifiers.md b/Modifiers.md index 4f7ffff..c395911 100644 --- a/Modifiers.md +++ b/Modifiers.md @@ -33,10 +33,10 @@ type User struct { Applying a Modifier to a struct attribute will cause KSQL to use this modifier when Inserting, Updating, and Querying that field. -A Modifier can therefore be used for: +A Modifier can therefore be used to: -1. Making any type of conversion on the attribute value before sending it to the database. -2. Making any type of conversion on the attribute value when reading it from the database. +1. Make any type of conversion on the attribute value before sending it to the database. +2. Make any type of conversion on the attribute value when reading it from the database. 3. Informing KSQL that this attribute should be ignored during Insertions and/or Updates. Modifiers improve on the `Valuer`/`Scanner` feature provided by the standard library in two ways: @@ -52,6 +52,7 @@ Modifiers improve on the `Valuer`/`Scanner` feature provided by the standard lib - `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. +- `nullable`: Modifiers the default behavior of ignoring nil pointers during Updates and Insertions, i.e. it makes it possible to set database columns to NULL, which was not possible before. On KSQL V2 this modifier might be removed in favor of an `Update()` function whose default behavior is to not ignore NULL fields. ### Registering new Modifiers