32 Commits

Author SHA1 Message Date
black-06
ac20d9e222
fix: unit test (#6250)
* fix: unit test

* fix create test

https://github.com/go-gorm/gorm/pull/6127#discussion_r1171214125

* style: rename to adaptorSerializerModel
2023-04-21 22:09:38 +08:00
Truong Nguyen
ed474152b1
Fix: Composite primary key with auto-increment value returns 0 after insert (#6127)
* Fix #4930 workaround for databases that support auto-increment in composite primary key.

* Add test for composite key with auto-increment.

* schema.go: use field.AutoIncrement instead of field.TagSettings["AUTOINCREMENT"], add test to check autoincrement:false

create_test.go: remove unused code: drop table CompositeKeyProduct

---------

Co-authored-by: Jinzhu <wosmvp@gmail.com>
2023-03-10 16:50:03 +08:00
Cr
e9f25c73ee
fix: on confilct with default null (#6129)
* fix: on confilct with default null

* Update create.go

---------

Co-authored-by: Jinzhu <wosmvp@gmail.com>
2023-03-10 16:35:26 +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
a65912c588
fix: FirstOrCreate RowsAffected (#5250) 2022-04-13 15:52:07 +08:00
Jinzhu
39d84cba5f Add serializer support (#5078)
* Update context

* Update GormFieldValuer

* Add Serializer

* Add Serializer Interface

* Refactor gorm field

* Refactor setter, valuer

* Add sync.Pool

* Fix test

* Add pool manager

* Fix pool manager

* Add poolInitializer

* Add Serializer Scan support

* Add Serializer Value method

* Add serializer test

* Finish Serializer

* Fix JSONSerializer for postgres

* Fix JSONSerializer for sqlserver

* Test serializer tag

* Add unixtime serializer

* Update go.mod
2022-02-19 17:02:53 +08:00
kinggo
b47cf57f5e
ci: add gofumpt check in reviewdog (#4973) 2022-01-06 15:02:53 +08:00
kinggo
ec58e3319f
fixed:panic when create value from nil struct pointer. (#4771)
* fixed:create nil pointer

* fixed:panic when create value from nil struct pointer.
2021-10-12 21:19:08 +08:00
Jinzhu
6848ae872f Fix gorm.Expr with SubQuery, fix #3857 2020-12-15 15:50:35 +08:00
Jinzhu
0c12a4c360 Add CreateBatchSize option 2020-12-02 14:59:50 +08:00
Jinzhu
a8db54afd6 Add CreateInBatches supports 2020-11-16 21:42:30 +08:00
Jinzhu
28121d4455 Fix panic when batch creating from slice contains invalid data, close #3385 2020-09-03 20:59:41 +08:00
Jinzhu
48b395b760 returns ErrEmptySlice when creating with zero length slice 2020-09-03 11:32:30 +08:00
Jinzhu
9fcc337bd1 Fix create from map 2020-08-17 17:41:36 +08:00
Jinzhu
6ed697dd02 TestFirstOrCreateWithPrimaryKey, close #3192 2020-07-23 23:41:56 +08:00
Jinzhu
1a2fabb34d Test Not 2020-07-05 11:56:12 +08:00
Hinagiku Soranoba
b733d16f56
Create supports Array / ArrayPtr (#3076)
* add Array / ArrayPtr create tests

* support create using array
2020-06-23 14:38:36 +08:00
Jinzhu
5883490aa7 Select, Omit, Preload supports clause.Associations 2020-06-20 17:21:01 +08:00
maiyama18
1bbaa43951
fix typos in test method names (#3052) 2020-06-14 09:24:07 +08:00
Jinzhu
8bb05a5a69 Refactor tests files 2020-06-02 10:50:38 +08:00
Jinzhu
5790ba9ef4 Fix package path 2020-06-02 09:25:55 +08:00
Jinzhu
e986371a42 Rename package name 2020-06-02 09:18:01 +08:00
Jinzhu
9d3e929790 Test Select, Omit with Create 2020-05-31 13:34:53 +08:00
Jinzhu
1546f8a4a1 Test CreateWithNoGORMPrimayKey 2020-05-31 12:52:49 +08:00
Jinzhu
b3b19a5577 Test Override NowFunc 2020-05-31 11:34:59 +08:00
Jinzhu
1e7eb12cba Test empty struct 2020-05-31 11:19:45 +08:00
Jinzhu
590f622674 Refactor create tests 2020-05-23 22:32:16 +08:00
Jinzhu
5ec4fee797 Don't preload if foreign keys zero 2020-05-23 21:09:03 +08:00
Jinzhu
e64785573d Add helper methods to check user, pet 2020-05-23 18:05:26 +08:00
Jinzhu
bb68f0d6b3 Refactor tests 2020-05-23 16:08:50 +08:00
Jinzhu
d833efe8b9 Work on clauses 2020-02-02 19:11:17 +08:00
Jinzhu
8cb15cadde Improve test structure 2020-02-02 08:35:01 +08:00