293 Commits

Author SHA1 Message Date
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
Vinícius Garcia
76830d5f5c Rename examples/testing/ to examples/example_service/ 2021-01-03 13:58:10 -03:00
Vinícius Garcia
689a60710d Update README to mention the example tests 2021-01-03 13:54:08 -03:00
Vinícius Garcia
e49aa5f620 Add example tests to examples/testing 2021-01-03 13:41:21 -03:00
Vinícius Garcia
7ab871dad2 Update README and add an usage example 2020-12-31 14:10:47 -03:00
Vinícius Garcia
20287a3740 Add Exec() function to the API 2020-12-31 13:31:30 -03:00
Vinícius Garcia
8a65da552f Rename struct tags from gorm to kissorm 2020-12-31 11:59:24 -03:00
Vinícius Garcia
49c2842c03 Remove gorm dependency! We are independent now! 2020-12-31 11:57:33 -03:00
Vinícius Garcia
3cbf059b02 Remove all remaining calls to gorm function from tests 2020-12-31 11:50:28 -03:00
Vinícius Garcia
eb02491414 Remove several calls to gorm function from tests 2020-12-31 10:31:26 -03:00
Vinícius Garcia
a6e54f0558 Fix sqlite warning by updating the package version 2020-12-30 15:19:08 -03:00
Vinícius Garcia
673e417b8e Triple check if all errors are being handled 2020-12-30 15:02:35 -03:00
Vinícius Garcia
45380718f5 Update TestQueryChunks() to work with postgres 2020-12-30 12:39:01 -03:00
Vinícius Garcia
995ccd680c Fix Delete() to work with postgres 2020-12-30 12:33:56 -03:00
Vinícius Garcia
ed8f0550aa Update TestQueryOne() to work with postgres 2020-12-30 12:28:37 -03:00
Vinícius Garcia
0cdaf00aaf Update TestQuery() to work with postgres 2020-12-30 12:26:35 -03:00
Vinícius Garcia
f782fabb37 Fix Update() to work with postgres dialect 2020-12-29 23:51:31 -03:00
Vinícius Garcia
de8f4e56d7 Fix Insert function to work with postgres
This commit adds the concept of dialects so we can support
different ways of escaping names, creating placeholders, etc.

Currently we are only using it on the Insert route and we only
support postgres and sqlite3, in the future we should add
more tests so we can start supporting more drivers.
2020-12-29 23:36:10 -03:00
Vinícius Garcia
a7b3c12b95 Remove gorm dependency from Insert()
Although this implementation was meant to work with sqlite and
postgres it was not yet tested with postgres.
2020-12-27 14:26:32 -03:00
Vinícius Garcia
4030768f22 Improve Delete tests 2020-11-26 23:21:45 -03:00
Vinícius Garcia
9e84e4bb1b Remove gorm dependency from Delete() 2020-11-26 22:35:36 -03:00
Vinícius Garcia
1ea81bb8e0 Remove gorm dependency from Query() func 2020-11-23 01:20:13 -03:00
Vinícius Garcia
13bd087cee Remove gorm dependency from QueryOne() 2020-11-22 22:34:24 -03:00
Vinícius Garcia
cdad1673f0 Remove gorm dependency from QueryChunks func 2020-11-21 02:51:17 -03:00