Commit Graph

55 Commits (568c61bdbaac88e3ff6d88289d85cb548e87a01f)

Author SHA1 Message Date
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 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 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 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 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 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 f06706b081 Fix scanRows to ignore extra columns from query without errors 2021-01-17 20:26:34 -03:00
Vinícius Garcia 5d083e35f0 Add tests for the Transaction function 2021-01-17 10:54:21 -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 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 e49aa5f620 Add example tests to `examples/testing` 2021-01-03 13:41:21 -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 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 7197f21c7e Add error case tests for scanRows() func 2020-11-21 02:45:46 -03:00
Vinícius Garcia b6f69d52aa Add private scanRows() function 2020-11-21 02:35:56 -03:00
Vinícius Garcia 6978474d41 Improve QueryChunks signature to be easier to use
The changes made on this commit were designed by
Raí Tamarindo (raitamarindo@gmail.com) on a previous meeting.
2020-10-28 08:55:58 -03:00
Vinícius Garcia 4c740118fd Improve tests for the Update() function 2020-10-25 18:04:33 -03:00
Vinícius Garcia 335c30154d Fix linter complaints 2020-10-20 21:19:57 -03:00
Vinícius Garcia 5822e23de4 Add tests to QueryChunks function
This commit also fixes some bugs on this function and
adds a feature: Now you can return an kissorm.AbortIteration
error to abort the iteration and stop processing chunks.

This does not causes the call to QueryChunks to return an error,
since this is an expected error, thus, it is just ignored.
2020-10-14 15:45:16 -03:00
Vinícius Garcia 654997b09b Improve coverate on Query & QueryOne funcs 2020-10-14 13:53:09 -03:00
Vinícius Garcia e8bd504703 Split the Find function into the Query & QueryOne functions 2020-10-13 21:39:39 -03:00
Vinícius Garcia a3bf34146d Replace Query&QueryNext for the new QueryChunks func 2020-10-09 15:26:00 -03:00
Vinícius Garcia ad77d0a1a0 Add FillSliceWith helper function 2020-09-30 22:11:41 -03:00
Vinícius Garcia 9844cb3e9a Add test for finding multiple users at once 2020-09-30 19:47:32 -03:00
Vinícius Garcia 54fa1f023a Remove GetByID function because it was redundant 2020-09-30 19:41:54 -03:00
Breno Almeida 614cfde4b7 improve iterator.Close to prevent accidental panics 2020-09-28 18:26:17 -03:00