Commit Graph

37 Commits (b3b9466013abfb8b1db53e76800b91a35b928023)

Author SHA1 Message Date
Vinícius Garcia 3701f0f325 Simplify repo example 2022-05-07 22:30:30 -03:00
Vinícius Garcia 527c79ad1c Add an example repository showing how to use transactions 2022-05-07 22:26:27 -03:00
Vinícius Garcia 550ba9e8d9 Update `examples/all_adapters` so it uses db.Close() 2022-04-22 19:19:19 -03:00
Vinícius Garcia e78fced5e6 Update all subpackages to use latest ksql version 2022-04-22 19:16:53 -03:00
Vinícius Garcia 76bad8c8f2 Try to fix CI again 2022-04-20 20:01:10 -03:00
Vinícius Garcia 3899bb8a75 Update go.mod for fixing CI 2022-04-20 19:20:41 -03:00
Vinícius Garcia 2e3c809c8c Update README and examples to use `defer db.Close()` 2022-04-19 11:13:02 -03:00
Vinícius Garcia 2bf3a1a124 Create new example test showing how to use ksql.Mock{} 2022-04-06 18:29:28 -03:00
Vinícius Garcia 60835ac429 Fix go.mod on examples module 2022-03-27 09:46:29 -03:00
Vinícius Garcia 18377f18f9 Try to fix codecov on CI 2022-03-15 19:55:08 -03:00
Vinícius Garcia 8eb3c86410 Refactor all adapters as separate modules 2022-03-15 13:03:41 -03:00
Vinícius Garcia 06b871a418 Deprecate kstructs in favor of ksqltest 2022-02-22 22:41:15 -03:00
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 a394fd0815 Move some functions to the internal package 2022-01-11 19:00:22 -03:00
Vinícius Garcia 00f4a6ceae Improve the read examples 2022-01-10 21:47:52 -03:00
Vinícius Garcia 6a4ec2cd51 Update Exec signature to return the number of affected rows 2021-11-26 22:13:56 -03:00
Vinícius Garcia a1403dc9d3 Simplify the signature of the Delete() method
This change was finally made because the Delete function was the
only helper function that was not returning the ksql.ErrRecordNotFound
when no rows were found.

The other reason for this change is that we the most common use case is
by far for deleting a single element, and the philosophy of the library
is to optimize for the most common use-cases.

For making it easier to write queries for deleting many items
as well as many other less common use cases we
are already implementing the `kbuilder` package which is a
query builder.
2021-11-22 19:42:33 -03:00
Vinícius Garcia 25781352cb Add adapters for each possible db technology 2021-11-14 14:54:01 -03:00
Vinícius Garcia b6e6667a3f Improve the names of some public types *breaking change* 2021-06-28 17:35:46 -03:00
Vinícius Garcia 5b351c8ba2 Rename package structs to kstructs so its unambiguous 2021-06-11 12:53:56 -03:00
Vinícius Garcia 20f49eb22b Reorganize files so the test helpers are grouped in the same pkg 2021-06-11 12:25:24 -03:00
Vinícius Garcia 5b9b0dd00d Add CallFunctionWithRows() for help testing calls to QueryChunks 2021-06-10 15:57:46 -03:00
Vinícius Garcia c0d7206dcc Breaking change: Update SQLProvider interface so methods receive table info as argument 2021-06-06 20:51:13 -03:00
Vinícius Garcia 35c1f42317 Remove var args from Insert and Update, so they actually perform atomic operations in the database 2021-03-12 11:01:36 -03:00
Vinícius Garcia 8b8fb092d8 Replace all instances of lower-cased kisssql for ksql 2021-03-10 10:11:18 -03:00
Vinícius Garcia 3d14ed0296 Add an example call to the Transaction function on README 2021-03-08 16:11:59 -03:00
Vinícius Garcia 568c61bdba Replace all ocurrencies of `KissORM` for `KissSQL` 2021-03-08 11:18:52 -03:00
Vinícius Garcia b38a83ff36 Improve the signature of the New() function so it`s more readable 2021-03-04 22:58:27 -03:00
Vinícius Garcia ff4952da65 Partially update example_service to include the JSON feature
Its only partial because currently the function `structs.FillStructWith`
doesn't support the attributes tagged as `kissorm:"?,json"`

The task of updating the FillStructWith was updated to include this
behavior
2021-03-04 22:24:15 -03:00
Vinícius Garcia 6f1885d3a0 Update examples/crud to include the JSON feature 2021-03-04 22:11:58 -03:00
Vinícius Garcia 304e5bde49 Extract struct helper functions into the structs package 2021-02-16 00:01:19 -03:00
Vinícius Garcia f655576bb3 Fix some comments so the linter stops complaining 2021-01-21 16:10:14 -03:00
Vinícius Garcia 5d083e35f0 Add tests for the Transaction function 2021-01-17 10:54:21 -03:00
Vinícius Garcia 479e47b018 Move example_service to examples 2021-01-15 23:35:17 -03:00
Vinícius Garcia 76830d5f5c Rename `examples/testing/` to `examples/example_service/` 2021-01-03 13:58:10 -03:00
Vinícius Garcia e49aa5f620 Add example tests to `examples/testing` 2021-01-03 13:41:21 -03:00