15 Commits

Author SHA1 Message Date
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
Vinícius Garcia
cb15295e46 Rename serializers to modifiers 2022-09-21 21:38:30 -03:00
Vinícius Garcia
f95cd2b7b2 Refactor code so that users can add their own serializers 2022-09-14 23:03:33 -03:00
Vinícius Garcia
8620600d01 Revert "Decouple ksql.DB from TagInfoCache so we can replace it during tests"
This reverts commit 74cb87bea027e7924e614a8f2ff0c9719f8dd4b6.

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.
2022-08-27 12:18:02 -03:00
Vinícius Garcia
4b37adc905 Add more tests to ksql.Query() 2022-08-27 12:16:46 -03:00
Vinícius Garcia
74cb87bea0 Decouple ksql.DB from TagInfoCache so we can replace it during tests 2022-08-24 22:45:24 -03:00
Matheus de Oliveira
db86670b6c Use sync.Map on global caches to avoid race-condition
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.
2022-07-04 17:28:27 -03:00
Vinícius Garcia
af6ee27e3a Add error check for unexported fields with the ksql tag 2022-05-02 23:11:31 -03:00
Vinícius Garcia
1ed7684b6d Add case-insensitive support for database columns
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.
2022-04-30 13:01:03 -03:00
Vinícius Garcia
a394fd0815 Move some functions to the internal package 2022-01-11 19:00:22 -03:00
Vinícius Garcia
db6b126c69 Finish writing tests for ParseInputFunc() 2022-01-10 21:55:40 -03:00
Vinícius Garcia
898bb887cc Fix linter issue 2022-01-10 21:49:05 -03:00
Vinícius Garcia
3102a3d4c4 Add tests to ParseInputFunc and move it to internal/ 2022-01-10 21:02:39 -03:00
Vinícius Garcia
0ff7a92d72 Add tests for the error messages produced by the Mock() 2021-12-30 12:12:33 -03:00