Commit Graph

12 Commits (dd8a45c5d50a13d74272646ec2050ae08bf6d14d)

Author SHA1 Message Date
Vinícius Garcia dd8a45c5d5 Rename kmodifiers to ksqlmodifiers 2022-10-18 12:57:27 -03:00
Vinícius Garcia 4890563c27 Expose some public types and functions so users can register new modifiers 2022-10-18 12:53:25 -03:00
Vinícius Garcia ad516d5e1f Add comment to json modifier 2022-10-18 10:50:58 -03:00
Vinícius Garcia 136ee66fe9 Fix behavior of json modifier to match what json.Unmarshal does for nil values
In the original implementation I thought that the `json` package
would set fields to its zero value during unmarshal if the input
JSON had a `null` value for that attribute.

After performing an small experiment I noticed this is not the case.

Thus, I have removed that behavior and now if the json contains
a `null` value for a field this field will be ignored by the
json modifier thus keeping its original value whatever it was.
2022-10-18 10:41:49 -03:00
Vinícius Garcia e48f82c255 Improve godoc for modifiers.LoadGlobalModifier 2022-10-18 10:35:36 -03:00
Vinícius Garcia 511abf659d Remove skipQueries option from modifiers since it was not working yet 2022-10-12 23:00:07 -03:00
Vinícius Garcia f41edb427d Add three new modifiers and fix a couple bugs
This commit adds these modifiers:

1. skipUpdates (with unit tests)
2. skipInserts (with unit tests)
3. skipQueries (no tests yet) (and not really working yet)

And handles two situations previously not considered:

1. Updates with no attributes will now return a properly formatted
   error instead of returning a syntax error.
2. Inserts with no values will now work on SQLite, Postgres and
   SQLServer
2022-10-12 22:47:33 -03:00
Vinícius Garcia 0d73ac9a18 Minor fix to the AttrModifier struct 2022-10-09 21:58:41 -03:00
Vinícius Garcia 57c0f4cade Add timeNowUTC and timeNowUTC/skipUpdates modifiers 2022-10-09 21:49:21 -03:00
Vinícius Garcia 8cba3efa2d Refactor modifiers so it is represented by a struct 2022-09-26 01:37:23 -03:00
Vinícius Garcia 9e94445cdc Add tests to the modifiers package 2022-09-23 22:49:41 -03:00
Vinícius Garcia 41f4d5487b Refactor modifiers into its own package 2022-09-21 22:30:20 -03:00