Commit Graph

277 Commits (2e1aa80770c31029985bb632d6c16717ff581be4)

Author SHA1 Message Date
Vinícius Garcia 2e1aa80770 Breaking Change: changes the Exec() signature so it returns an extra value
The signature was updated from

- `Exec(...) (rowsAffected int64, _ error)`

To:

- `Exec(...) (ksql.Result, error)`

Result is an interface, so it should be easy to mock, we are also
providing a new builtin mock struct + constructor to make it even easier:

Building new mock Result: `ksql.NewMockResult(lastInsertID int64, rowsAffected int64) Result`
2022-02-22 16:49:48 -03:00
Vinícius Garcia 7a57e38228 Deprecate Update() in favor of a better fn name: Patch() 2022-02-22 16:14:15 -03:00
Vinícius Garcia 1c2421d1de Fix `make lint` so it is less verbose 2022-02-20 09:58:04 -03:00
Vinícius Garcia cea28ace2b Refactor TestTransaction() so its decoupled from the adapters 2022-02-19 10:56:47 -03:00
Vinícius Garcia 90f63e5f14 Update TestQueryChunks() so its decoupled from the adapters 2022-02-19 10:52:33 -03:00
Vinícius Garcia c7e6303cbc Refactor TestUpdate() so its decoupled from the adapters 2022-02-19 10:46:57 -03:00
Vinícius Garcia 21166c93a1 Update TestDelete so its decoupled from the adapters 2022-02-19 02:58:32 -03:00
Vinícius Garcia 0b0e3a2901 Update TestInsert so its decoupled from the adapters 2022-02-19 02:55:59 -03:00
Vinícius Garcia eb030b1d76 Refactor TestQuery() to use the `tt` package 2022-02-19 02:51:07 -03:00
Vinícius Garcia b1737c8c30 Refactor TestQueryOne to use the `tt` package 2022-02-19 02:30:06 -03:00
Vinícius Garcia 9fd5bab3c4 Update TestQueryOne() so its decoupled from the adapters 2022-02-19 02:10:38 -03:00
Vinícius Garcia 488f5ba71d Refactor TestQuery() to decouple it from the DBAdapter 2022-02-15 23:51:58 -03:00
Vinícius Garcia 3e275804d0 Add a few more tests and error checks to Delete() 2022-02-12 11:50:32 -03:00
Vinícius Garcia a37b8382ee Refactor Delete() so the code is even simpler 2022-02-12 10:09:38 -03:00
Vinícius Garcia 0b3969be1e Add test for Delete() with maps as arguments 2022-02-12 08:12:04 -03:00
Vinícius Garcia 44f95059f7 Temporarily ignore the kbuilder in codecov since it is not currently ready to use 2022-02-12 00:06:58 -03:00
Vinícius Garcia 07c6065a5b Add tests and simplify the Delete function with composite keys 2022-02-11 23:59:29 -03:00
Vinícius Garcia d1e97489ef Add some tests for invalid tables passed to Delete() 2022-02-11 17:30:42 -03:00
Vinícius Garcia 49f872fb84 Add more tests for inserting in tables with composite keys 2022-02-11 17:23:47 -03:00
Vinícius Garcia 249d8db409 Improve user_permissions table used in tests for allowing more interesting tests 2022-01-25 11:32:03 -03:00
Vinícius Garcia 45e6f9ce55 Add first test for tables with composite primary keys 2022-01-22 23:25:37 -03:00
Vinícius Garcia 0776e9f89b Add unit tests to GetDriverDialect() func 2022-01-22 19:11:02 -03:00
Vinícius Garcia eded1b5dfd Add more tests for FillStructWith to improve code coverage 2022-01-20 19:51:19 -03:00
Vinícius Garcia 709d208b8e Add more tests to TestFillStructWith to increase test coverage 2022-01-20 19:39:14 -03:00
Vinícius Garcia bfceec04e2 Add TestCallFunctionWithRows to increase test coverage 2022-01-20 19:32:54 -03:00
Vinícius Garcia 53c48aecce Update benchmarks 2022-01-20 18:54:08 -03:00
Vinícius Garcia 6c90673bef Fix benchmarks to stop using deprecated constructor 2022-01-20 18:53:35 -03:00
Vinícius Garcia e4c2151fad Simplify codecov.yml 2022-01-12 18:25:44 -03:00
Vinícius Garcia 865f52cb21 Try to fix codecov ignore list 2022-01-12 18:22:03 -03:00
Vinícius Garcia e48c8a0902 Try to ignore the internal files again 2022-01-11 19:15:52 -03:00
Vinícius Garcia 338fc7b266 Add internal/structs to .gitignore 2022-01-11 19:05:23 -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 00f4a6ceae Improve the read examples 2022-01-10 21:47:52 -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 23efe48869 Add final tests to the Mock struct 2021-12-31 01:04:34 -03:00
Vinícius Garcia 3613ad769a Add more tests to the mocks for codecov 2021-12-31 00:41:20 -03:00
Vinícius Garcia 3b7209b115 Again 2021-12-30 22:26:08 -03:00
Vinícius Garcia 002116eb38 Last attempt to make codecov ignore the examples 2021-12-30 20:07:36 -03:00
Vinícius Garcia 397df84022 Try to make codecov ignore example files again 2021-12-30 19:10:13 -03:00
Vinícius Garcia 3665e29724 Try to ignore the code coverage of the examples again 2021-12-30 12:54:13 -03:00
Vinícius Garcia b8cbfbd45b Improve doc comments on mocks.go 2021-12-30 12:53:46 -03:00
Vinícius Garcia 5b2627e596 Second attempt at ignoring coverage of the example files 2021-12-30 12:26:18 -03:00
Vinícius Garcia f26d943802 Add examples to codecov ignore 2021-12-30 12:17:00 -03:00
Vinícius Garcia ceb75c1932 Add testtools to codecov.yml ignore list 2021-12-30 12:13:17 -03:00
Vinícius Garcia 0ff7a92d72 Add tests for the error messages produced by the Mock() 2021-12-30 12:12:33 -03:00
Vinícius Garcia 6f2ecbef5a Write tests for two trivial functions for raising the test coverage 2021-12-28 22:09:28 -03:00
Vinícius Garcia 1e282717b7 Remove deprecated constructors ksql.New() and ksql.NewWithPgx()
It's recommended to use instead one of:

- kpgx.New(ctx, connURL, ksql.Config{})
- kmysql.New(ctx, connURL, ksql.Config{})
- ksqlserver.New(ctx, connURL, ksql.Config{})
- ksqlite3.New(ctx, connURL, ksql.Config{})
2021-12-28 21:37:07 -03:00
Vinícius Garcia d98cf857c0 Improve README 2021-12-28 21:11:09 -03:00