Commit Graph

116 Commits (35c1f42317f9533a45f95feb427064fb386b3638)

Author SHA1 Message Date
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 df7db29464 Rename files kisssql* to ksql* 2021-03-11 22:08:18 -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 fd659b9c0c Rename kiss_orm* files to kisssql* 2021-03-08 17:01:53 -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 1972ccd989 Fix typo on README 2021-03-08 13:34:45 -03:00
Vinícius Garcia 568c61bdba Replace all ocurrencies of `KissORM` for `KissSQL` 2021-03-08 11:18:52 -03:00
Vinícius Garcia 0bd858efee Update TODO list on README 2021-03-04 22:59:26 -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 d91c7cfcfd Update benchmark 2021-03-04 22:30:33 -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 097cd943fd Update README file 2021-03-02 22:53:10 -03:00
Vinícius Garcia 665bd35a85 Update TestQueryChunks to include the new json feature 2021-03-02 22:49:20 -03:00
Vinícius Garcia 8c425e93d5 Update TestQuery to include the `json` feature 2021-03-02 22:38:47 -03:00
Vinícius Garcia 587c620a75 Update TestQueryOne to include the `json` feature 2021-03-02 22:16:29 -03:00
Vinícius Garcia d56edab07a Rerun `make setup` and `go mod tidy` 2021-03-02 22:00:34 -03:00
Vinícius Garcia 0cf36fcdef Fix make setup recipe 2021-03-02 21:59:16 -03:00
Vinícius Garcia 3d989464a6 Update TestInsert to also test the json feature 2021-03-02 21:58:13 -03:00
Vinícius Garcia 9e3af68fd5 Update tests to work with a JSON field (currently only set to nil) 2021-02-28 20:48:03 -03:00
Vinícius Garcia 3faaa4d152 Add feature for automatically serialize fields tagged as "*,json"
This commit implements the features, but it still needs tests
to confirm it is working.
2021-02-28 13:07:32 -03:00
Vinícius Garcia f5b7ab8028 Refactor the structInfo struct so it can accept more information 2021-02-28 12:25:42 -03:00
Vinícius Garcia 933ded26f4 Test Insert when the ID retrieval is not supported 2021-02-27 13:00:55 -03:00
Vinícius Garcia c768876908 Add error test cases to TestInsert 2021-02-27 11:25:04 -03:00
Vinícius Garcia 67a0b2f1cc Add test cases for when the QueryChunks callback returns an error 2021-02-26 23:20:22 -03:00
Vinícius Garcia 1d4adece95 Add error test cases for QueryChunk() 2021-02-26 23:14:44 -03:00
Vinícius Garcia 6fe450d057 Fix a few tests that were still hardcoded to use only one db provider 2021-02-26 22:47:09 -03:00
Vinícius Garcia e044d1fc30 Add error test case to QueryOne() for invalid SQL 2021-02-26 22:43:32 -03:00
Vinícius Garcia e7e89b63ef Add error test case to Query() for invalid SQL 2021-02-26 22:41:14 -03:00
Vinícius Garcia f0e5674e79 Add tests with slice of pointers for the Query function 2021-02-26 22:13:15 -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 203b141aca Add support for tables with composite keys 2021-02-15 20:57:51 -03:00
Vinícius Garcia e1e711dc91 Add a Benchmark comparing us with the sqlx package 2021-01-22 21:25:14 -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 f9a6372b8a Remove error check when dropping test tables
It was prevent the tests from running
2021-01-21 16:03:04 -03:00
Vinícius Garcia 77631f480c Smal improvement on the README file 2021-01-20 11:03:38 -03:00
Vinícius Garcia ded48b3a7d Remove undocumented and unused function `ChangeTable` 2021-01-17 20:41:03 -03:00
Vinícius Garcia 0f49ad180d Sort README #TODO List in order of priority 2021-01-17 20:29:51 -03:00
Vinícius Garcia 47dc19087f Use errors.Wrap(sql.ErrNoRows, "..") to make ErrRecordNotFound more idiomatic 2021-01-17 20:27:12 -03:00
Vinícius Garcia f06706b081 Fix scanRows to ignore extra columns from query without errors 2021-01-17 20:26:34 -03:00
Vinícius Garcia 0b97dbcff7 Improve reflection checks on Insert() function 2021-01-17 19:25:21 -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 400f94e088 Update ORMProvider interface displayed on README 2021-01-15 10:46:47 -03:00
Vinícius Garcia 9d717717d4 Add initial version of Transaction() function 2021-01-14 23:56:58 -03:00
Vinícius Garcia f72ccb1664 Change type of Client.db to be an interface
This will be helpful soon when we add the Transactions feature
2021-01-14 23:02:12 -03:00
Vinícius Garcia ea7a23f32f Fix bug on FillStructWith so it ignores extra columns correctly
This bug was not being detected before because depending
on the order of the attributes on a map instance this test
would succeed by accident.

I was lucky enough to reproduce this error enough times to
understand it so it was possible to fix it.
2021-01-12 22:34:56 -03:00
Vinícius Garcia 247cdc0fd6 Add docker-compose.yml to setup a postgres database for tests 2021-01-12 22:19:24 -03:00
Vinícius Garcia 98cbc4e161 Fix database locked errors on tests
There was a missing `defer rows.Close()` on the ScanRows tests.
2021-01-12 22:18:59 -03:00
Vinícius Garcia 1d3fadc1f2 Update README.md 2021-01-12 20:46:29 -03:00