Commit Graph

55 Commits (4352f659c182122840d8f9ee4db18c55c9a96406)

Author SHA1 Message Date
Vinícius Garcia 4352f659c1 Add logs to debug 2024-10-29 23:06:43 -03:00
Vinícius Garcia 4b5464c1de Fix `insertWithLastInsertID()` so it also works with *string IDs 2024-10-29 00:06:24 -03:00
Vinícius Garcia dcee1a01a4 Fix `insertWithLastInsertID()` so it doesnt try to retrieve string IDs 2024-10-28 23:45:41 -03:00
Vinícius Garcia 9f12a3691f Minor fixes for making the tests work for the kpostgres adapter 2024-01-22 10:32:34 -03:00
Vinícius Garcia 9a006cd25c Update Delete() method to work with qualified table names 2024-01-17 00:26:05 -03:00
Vinícius Garcia 06fe81e064 Update Patch to work with qualified table names 2024-01-16 23:34:17 -03:00
Vinícius Garcia d933794459 Update Insert() method to work with qualified table names 2024-01-16 23:18:39 -03:00
Vinícius Garcia 7ba6537ed9 Refactor tests so we dont depend directly on database/sql nor pq 2023-08-14 10:36:19 -03:00
Vinícius Garcia a9487aae55 Remove Update method deprecated on Feb 2022 2023-05-21 11:10:20 -03:00
Vinícius Garcia 482f979db7 Merge branch 'master' of github.com:VinGarcia/ksql into add-pgx5-adapter 2023-04-04 23:10:53 -03:00
Vinícius Garcia ec1f5f6151 Minor improvement on the organization of tests on test_adapters.go 2023-04-04 23:08:29 -03:00
Vinícius Garcia 8f45498f58 Improve error message for structs missing required ID fields 2023-04-02 11:37:25 -03:00
Vinícius Garcia f183327eec Fix minor mistake on tests 2022-12-21 22:15:30 -03:00
Vinícius Garcia 24599e6644 Improve NewWithAdapter to expect a dialect instead of a driver name 2022-12-21 21:23:54 -03:00
Vinícius Garcia 0f2ce0a685 Minor refactor: remove the DB.driver field 2022-12-20 23:07:39 -03:00
Vinícius Garcia 226b906746 Minor fix to test 2022-12-17 14:36:18 -03:00
Vinícius Garcia 743d021f7a Improve test by adding comment 2022-12-17 14:34:26 -03:00
Vinícius Garcia 1a1f198803 Fix linter complaint 2022-12-17 14:16:12 -03:00
Vinícius Garcia 88167361c1 Add tests to the nullable Modifier 2022-12-15 19:48:31 -03:00
Vinícius Garcia 83cf354f35 Add TDD tests for checking if context was cancelled 2022-11-29 09:18:34 -03:00
Vinícius Garcia f4cac02602 Minor refactor on tests 2022-11-29 07:24:23 -03:00
Vinícius Garcia 5bfb5cd92a Improve error messages for scan errors on all adapters 2022-11-12 15:20:06 -03:00
Vinícius Garcia e519b3db27 Minor improvement to one test 2022-10-31 13:03:26 -03:00
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 5a7fd93467 Add one extra test for inserting with no values 2022-10-18 09:35:09 -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 57c0f4cade Add timeNowUTC and timeNowUTC/skipUpdates modifiers 2022-10-09 21:49:21 -03:00
Vinícius Garcia ae76cd5768 Merge branch 'master' of github.com:VinGarcia/ksql into add-attr-middlewares 2022-10-08 22:35:40 -03:00
Vinícius Garcia 8538d99468 Remove unnecessary dependency on github.com/pkg/errors 2022-10-08 14:56:30 -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 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 67ad75242a Improve some error messages 2022-08-27 12:33:18 -03:00
Vinícius Garcia 86dd623eac Improve some error messages 2022-08-27 12:28:39 -03:00
Vinícius Garcia 8620600d01 Revert "Decouple ksql.DB from TagInfoCache so we can replace it during tests"
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.
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
Vinícius Garcia 45d8ef4491 Finishes testing all error cases in the .Transaction() method 2022-08-03 21:05:20 -03:00
Vinícius Garcia 25e77f3f36 Improve code coverage for .Transaction() 2022-08-03 20:58:09 -03:00
Vinícius Garcia 06b8855621 Improve test coverate on .Transaction() 2022-08-03 20:46:32 -03:00
Vinícius Garcia b5f2deac02 Add a few more tests to Transaction 2022-08-03 20:11:05 -03:00
Vinícius Garcia 752e6bb0a1 Add some tests for the Patch function with composite keys 2022-07-25 23:47:06 -03:00
Vinícius Garcia dc345c501b Minor refactor on tests 2022-07-25 23:04:41 -03:00
Vinícius Garcia 0425eb1123 Add test for Patch with composite keys 2022-07-25 22:49:51 -03:00
Vinícius Garcia 5328be8564 Add more tests to Delete 2022-07-25 19:59:36 -03:00
Jadson Medeiros e464f3b6ea chenged reference from assert.NotEqual to tt.AssertNotEqual 2022-07-06 21:53:23 -03:00
Jadson Medeiros 985254ad3e applied new refactor to test lib 2022-07-06 21:43:17 -03:00