mirror of
https://github.com/VinGarcia/ksql.git
synced 2025-09-04 19:36:56 +00:00
Updated Modifiers (markdown)
parent
2c3a88db8e
commit
bfae00c16f
@ -1,4 +1,4 @@
|
||||
### What is a KSQL Modifier?
|
||||
## What is a KSQL Modifier?
|
||||
|
||||
A KSQL modifier is a special tag you can add to any of the attributes of your struct to alter the behavior of KSQL when reading or writing that attribute into the database. To use it, it is necessary to add the name of the modifier on the `ksql` tag after a comma, e.g.:
|
||||
|
||||
@ -17,8 +17,7 @@ A Modifier can therefore be used for:
|
||||
2. Making 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.
|
||||
|
||||
This feature was created as a generic solution to the problem of modifying how some attributes are written/read from the database.
|
||||
They should be easier to use than the `sql.Valuer` and `sql.Scanner` interfaces for two reasons:
|
||||
Modifiers improve on the `Valuer`/`Scanner` feature provided by the standard library in two ways:
|
||||
|
||||
1. They are not coupled to the type of the attribute, but to the attribute itself.
|
||||
2. They are reusable: You create it once and you can use it in many attributes of many different types.
|
||||
|
Loading…
x
Reference in New Issue
Block a user