Commit Graph

53 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 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 1d4adece95 Add error test cases for QueryChunk() 2021-02-26 23:14:44 -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 ded48b3a7d Remove undocumented and unused function `ChangeTable` 2021-01-17 20:41:03 -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 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 e49aa5f620 Add example tests to `examples/testing` 2021-01-03 13:41:21 -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 673e417b8e Triple check if all errors are being handled 2020-12-30 15:02:35 -03:00
Vinícius Garcia 995ccd680c Fix Delete() to work with postgres 2020-12-30 12:33:56 -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 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
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 a05d26418f Improve comments for the QueryChunks func 2020-10-28 21:30:10 -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 c1f645216c Improve Update() to pass context to Exec 2020-10-26 15:32:22 -03:00
Vinícius Garcia 733284997f fixup! Remove the gorm dependency from the Update func 2020-10-26 13:21:48 -03:00
Vinícius Garcia 8c1c483462 Improve comments on StructToMap() 2020-10-26 09:36:33 -03:00
Vinícius Garcia 417ea4660f Remove the gorm dependency from the Update func 2020-10-26 00:15:24 -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 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 76e5ad0f0f Improve comment on FillSliceWith() helper func 2020-09-30 22:12:00 -03:00
Vinícius Garcia ad77d0a1a0 Add FillSliceWith helper function 2020-09-30 22:11:41 -03:00
Vinícius Garcia 54fa1f023a Remove GetByID function because it was redundant 2020-09-30 19:41:54 -03:00
Vinícius Garcia 1a08c61198 Fix english on comment 2020-09-29 15:59:04 -03:00
Breno Almeida 614cfde4b7 improve iterator.Close to prevent accidental panics 2020-09-28 18:26:17 -03:00
Breno Almeida fabffed6d1 apply linter suggestions & make structToMap public 2020-09-28 16:50:27 -03:00
Breno Almeida cb27801a20 finish implementing query & queryNext funcs 2020-09-24 19:26:59 -03:00
Vinícius Garcia 6c725a69f5 Add Query & QueryNext funcs 2020-09-24 14:17:19 -03:00
Vinícius Garcia d77fd7d679 Add func UpdateStructWith() for facilitating mocking this ORM 2020-09-22 21:07:03 -03:00