* Implement Generics API
* Add more generics tests
* Add more tests and Take method
* use delayed‑ops pipeline for generics API
* fix generics tests for mysql
* Support SubQuery for Generics
* Add clause.JoinTable helper method
* Fix golangci-lint error
* Complete the design and implementation of generic version Join
* improve generics version Joins support
* allow configuring select/omit columns for joins via subqueries
* finish generic version Preload
* handle error of generics Joins/Preload
* fix tests
* Add LimitPerRecord for generic version Preload
* fix tests for mysql 5.7
* test for nested generic version Join/Preload
* Add WithResult support for generics API
* test reuse generics db conditions
* fix data race
* remove ExampleLRU test
* Add default transaction timeout support
* fix test
* test: add nested transaction and prepareStmt coexist test case
note: please test in the MySQL environment
Change-Id: I0db32adc5f74b0d443e98943d3b182236583b959
Signed-off-by: 王柳洋 <wangliuyang.520@bytedance.com>
* fix(nested transaction): SavePoint SQL Statement not support in Prepared Statements
1. SavetPoint SQL Statement not support in Prepared Statements
e.g. see mysql8.0 doc: https://dev.mysql.com/doc/refman/8.0/en/sql-prepared-statements.html
Change-Id: I082012db9b140e8ec69764c633724665cc802692
Signed-off-by: 王柳洋 <wangliuyang.520@bytedance.com>
* revert(transaction_api): remove savepoint name pool,meaningless
Change-Id: I84aa9924fc54612005a81c83d66fdf8968ee56ad
Signed-off-by: 王柳洋 <wangliuyang.520@bytedance.com>
---------
Signed-off-by: 王柳洋 <wangliuyang.520@bytedance.com>
Co-authored-by: 王柳洋 <wangliuyang.520@bytedance.com>
Add comments to functions in chainable_api. Depending on the method,
these comments add some additional context or details that are relevant
when reading the function, link to the actual docs at gorm.io/docs, or
provide examples of use. These comments should make GORM much more
pleasant to use with an IDE that provides hoverable comments, and are
minimal examples.
Also add in-code documentation to FirstOrInit and FirstOrCreate.
Almost all examples are directly pulled from the docs, with short
comments explaining the code. Most examples omit the `db.Model(&User{})`
for brevity, and would not actually work.
Co-authored-by: Nate Armstrong <nate.armstrong@eluv.io>
* Inherit clone flag (NewDB) on transaction creation
I find it very reassuring to know that after a finisher API, I get a clean db object for my next queries.
If you look at the example in https://gorm.io/docs i’d see many queries running one after the other.. but in reality they wouldn’t work as the they are portrayed and that’s because in default mode NewDB is false and will make all the clauses stay even after a finisher API.
My solution is just to have the value of the clone flag in the “parent” db object, be injected to its children transactions.
* Fix typo