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.
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
This reverts commit 74cb87bea0.
This was done because I noticed this first commit was unnecessary.
This original commit was written in order to allow tests where
the cache would return errors, but I noticed there is a way
of provoking these errors without the need of an extra layer
of abstraction.
Thus, in order to keep the code simpler and also avoid an extra
level of indirection I am undoing this change.
As known, a map can't be accessed with read/write concurrently on
multiple goroutines. This just replaces all uses of global maps for
caches with sync.Map, which is safe to be used concurrently.
Some databases (maybe all of them) will set the database column
names to lowercase.
This was problematic because we needed to match these names
with the ksql tags, which were not lowercased.
Now we support both versions, lowercased or not.