Commit Graph

497 Commits

Author SHA1 Message Date
Jinzhu 3f20a543fa Support use clause.Interface as query params 2022-10-18 18:01:55 +08:00
viatoriche / Maxim Panfilov 62593cfad0 add test: TestAutoMigrateInt8PG: shouldn't execute ALTER COLUMN TYPE smallint, close #5762 2022-10-18 17:28:06 +08:00
Jinzhu a0f4d3f7d2 Save as empty string for not nullable nil field serialized into json 2022-10-18 16:25:39 +08:00
Jinzhu ab5f80a8d8 Save as NULL for nil object serialized into json 2022-10-18 15:44:56 +08:00
Cr 186e8a9e14
fix: association without pks (#5779) 2022-10-18 11:58:42 +08:00
Jinzhu 2a788fb20c Upgrade tests go.mod 2022-10-17 17:01:42 +08:00
Jinzhu 2c56954cb1 tests mariadb with returning support 2022-10-08 20:48:22 +08:00
Jinzhu e93dc3426e Test postgres autoincrement check 2022-10-08 17:16:32 +08:00
Jinzhu 983e96f142 Add tests for alter column type 2022-10-08 16:04:57 +08:00
Jinzhu 34fbe84580 Add TableName with NamingStrategy support, close #5726 2022-10-07 21:18:37 +08:00
Wen Sun 9564b82975
Fix OnConstraint builder (#5738) 2022-10-07 13:46:20 +08:00
Cr 0b7113b618
fix: prepare deadlock (#5568)
* fix: prepare deadlock

* chore[ci skip]: code style

* chore[ci skip]: test remove unnecessary params

* fix: prepare deadlock

* fix: double check prepare

* test: more goroutines

* chore[ci skip]: improve code comments

Co-authored-by: Jinzhu <wosmvp@gmail.com>
2022-09-30 18:13:36 +08:00
Stephano George a3cc6c6088 Fix: wrong value when Find with Join with same column name, close #5723, #5711 2022-09-30 17:18:42 +08:00
jesse.tang be440e7512
fix possible nil panic in tests (#5720)
* fix maybe nil panic

* reset code
2022-09-30 11:14:34 +08:00
Nguyen Huu Tuan 328f301982
add some test case which related the logic (#5477) 2022-09-22 18:35:21 +08:00
kinggo 12237454ed fix: use preparestmt in trasaction will use new conn, close #5508 2022-09-22 16:47:43 +08:00
Cr 101a7c789f
fix: scan array (#5624)
Co-authored-by: Jinzhu <wosmvp@gmail.com>
2022-09-22 15:51:47 +08:00
Jinzhu 3a72ba102e Allow shared foreign key for many2many jointable 2022-09-22 15:03:41 +08:00
Cr 5ed7b1a65e
fix: same embedded filed name (#5705) 2022-09-22 11:25:03 +08:00
Jiepeng Cao b3eb1c8c51
simplified regexp (#5677) 2022-09-05 15:39:19 +08:00
Cr d71caef7d9
fix: remove uuid autoincrement (#5620) 2022-09-03 20:00:21 +08:00
Shunsuke Otani 8c3018b96a
Replace `ioutil.Discard` with `io.Discard` (#5603) 2022-08-15 10:50:06 +08:00
hjwblog.com 6e03b97e26
fix: empty serilizer err #5524 (#5525)
* fix: empty serilizer err #5524

* feat: fix UnixSecondSerializer return nil

* feat: split type case

Co-authored-by: huanjiawei <huanjiawei@bytedance.com>
2022-07-27 13:59:47 +08:00
Cr 06e174e24d
fix: embedded default value (#5540) 2022-07-25 14:10:30 +08:00
Jinzhu 75720099b5 Create a new db in FindInBatches 2022-07-18 18:07:05 +08:00
Goxiaoy 2ba599e8b7
fix empty QueryClauses in association (#5502) (#5503)
* fix empty QueryClauses in association (#5502)

* test: empty QueryClauses in association (#5502)

* style: empty QueryClauses in association (#5502)

* style: empty QueryClauses in association (#5502)
2022-07-15 11:15:18 +08:00
Jinzhu 4d40e34734 Update select tests 2022-07-14 14:55:54 +08:00
Jinzhu 62fdc2bb3b Fix serializer with empty string 2022-07-11 11:51:05 +08:00
Jinzhu fe01e1b9f4 Fix Model with slice data 2022-07-07 14:43:33 +08:00
Cr 46bce170ca
test: pg array type (#5480) 2022-07-04 16:42:27 +08:00
Cr c74bc57add
fix: association many2many duplicate elem (#5473)
* fix: association many2many duplicate elem

* chore: gofumpt style
2022-07-01 15:12:15 +08:00
Cr 235c093bb9
fix(MigrateColumn):declared different type without length (#5465) 2022-06-29 10:07:42 +08:00
wws 3e6ab99043
fix:serializer contain field panic (#5461) 2022-06-25 16:32:47 +08:00
Cr 8d45714628
fix: reset null value in slice (#5417)
* fix: reset null value in slice

* fix: can not set field in-place in join
2022-06-14 13:48:50 +08:00
Bexanderthebex d01de7232b
enhancement: Avoid calling reflect.New() when passing in slice of values to `Scan()` (#5388)
* fix: reduce allocations when slice of values

* chore[test]: Add benchmark for scan

* chore[test]: add bench for scan slice

* chore[test]: add bench for slice pointer and improve tests

* chore[test]: make sure database is empty when doing slice tests

* fix[test]: correct sql delete statement

* enhancement: skip new if rows affected = 0
2022-06-01 11:50:57 +08:00
dependabot[bot] f4e9904b02
chore(deps): bump gorm.io/driver/mysql from 1.3.3 to 1.3.4 in /tests (#5385)
Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.3.3 to 1.3.4.
- [Release notes](https://github.com/go-gorm/mysql/releases)
- [Commits](https://github.com/go-gorm/mysql/compare/v1.3.3...v1.3.4)

---
updated-dependencies:
- dependency-name: gorm.io/driver/mysql
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-01 10:26:09 +08:00
Cr 93986de8e4
fix: migrate column default value (#5359)
Co-authored-by: Jinzhu <wosmvp@gmail.com>
2022-05-28 23:09:13 +08:00
t-inagaki@hum_op dc1ae394f3
fixed FirstOrCreate not handled error when table is not exists (#5367)
* fixed FirstOrCreate not handled error when table is not exists

* delete useless part
2022-05-28 22:18:43 +08:00
Cr 7e13b03bd4
fix: duplicate column scan (#5369)
* fix: duplicate column scan

* fix: dup filed in inconsistent schema and database

* chore[ci skip]: gofumpt style

* chore[ci skip]: fix typo
2022-05-28 22:18:07 +08:00
Cr 7d1a92d60e
test: test for skip prepared when auto migrate (#5350) 2022-05-22 16:12:28 +08:00
Cr 7496c3a56e
fix: trx in hooks clone stmt (#5338)
* fix: trx in hooks

* chore: format by gofumpt
2022-05-17 14:13:41 +08:00
black-06 f5e77aab2f
fix: quote index when creating table (#5331) 2022-05-17 10:59:53 +08:00
Cr 373bcf7aca
fix: many2many auto migrate (#5322)
* fix: many2many auto migrate

* fix: uuid ossp
2022-05-09 10:07:18 +08:00
Cr 19b8d37ae8
fix: preload with skip hooks (#5310) 2022-05-04 18:57:53 +08:00
Cr b0104943ed
fix: callbcak sort when using multiple plugin (#5304) 2022-04-30 09:57:16 +08:00
Heliner d3488ae6bc
fix: add judge result of auto_migrate (#5306)
Co-authored-by: fredhan <fredhan@futunn.com>
2022-04-30 09:50:53 +08:00
Cr bd7e42ec65
fix: AutoMigrate with special table name (#5301)
* fix: AutoMigrate with special table name

* test: migrate with special table name
2022-04-27 21:13:48 +08:00
Jinzhu 6a6dfdae72 Refactor FirstOrCreate, FirstOrInit 2022-04-26 17:16:48 +08:00
Cr a0cc631272
test: test for postgrs serial column (#5234)
* test: test for postgrs sercial column

* test: only for postgres

* chore: spelling mistake

* test: for drop sequence
2022-04-24 12:13:27 +08:00
Cr 9b80fe9e96
fix: stmt.Changed zero value filed behavior (#5281)
* fix: stmt.Changed zero value filed behavior

* chore: rename var
2022-04-24 09:08:52 +08:00