Commit Graph

435 Commits

Author SHA1 Message Date
Jinzhu 0097b39a77 Should ignore error when parsing default value for time, close #5176 2022-03-20 08:55:08 +08:00
Cr d402765f69
test: fix utils.AssertEqual (#5172) 2022-03-18 20:11:23 +08:00
ag9920 3c00980e01 fix: serializer use default valueOf in assignInterfacesToValue, close #5168
commit 58e1b2bffbc216f2862d040fb545a8a486e473b6
Author: Jinzhu <wosmvp@gmail.com>
Date:   Fri Mar 18 17:06:43 2022 +0800

    Refactor #5168

commit fb9233011d
Author: ag9920 <alexgong7@outlook.com>
Date:   Thu Mar 17 21:23:28 2022 +0800

    fix: serializer use default valueOf in assignInterfacesToValue
2022-03-18 17:12:17 +08:00
chenrui 5431da8caf fix: preload panic when model and dest different close #5130
commit e8307b5ef5273519a32cd8e4fd29250d1c277f6e
Author: Jinzhu <wosmvp@gmail.com>
Date:   Fri Mar 18 13:37:22 2022 +0800

    Refactor #5130

commit 40cbba49f3
Author: chenrui <chenrui@jingdaka.com>
Date:   Sat Mar 5 17:36:56 2022 +0800

    test: fix test fail

commit 66d3f07829
Author: chenrui <chenrui@jingdaka.com>
Date:   Sat Mar 5 17:29:09 2022 +0800

    test: drop table and auto migrate

commit 7cbf019a93
Author: chenrui <chenrui@jingdaka.com>
Date:   Sat Mar 5 15:27:45 2022 +0800

    fix: preload panic when model and dest different
2022-03-18 13:38:46 +08:00
chenrui c2e36ebe62 fix: soft delete for join, close #5132
commit a83023bdfc0dc6eaccc6704b64ff6436c2fe7725
Author: Jinzhu <wosmvp@gmail.com>
Date:   Fri Mar 18 01:05:25 2022 +0800

    Refactor #5132

commit 8559f51102
Author: chenrui <chenrui@jingdaka.com>
Date:   Mon Mar 7 20:33:12 2022 +0800

    fix: should add deleted_at exprs for every joins

commit 2b7a1bdcf3
Author: chenrui <chenrui@jingdaka.com>
Date:   Mon Mar 7 14:46:48 2022 +0800

    test: move debug flag

commit ce13a2a7bc
Author: chenrui <chenrui@jingdaka.com>
Date:   Mon Mar 7 14:39:56 2022 +0800

    fix: soft delete for join.on
2022-03-18 01:09:20 +08:00
chenrui 9b9ae325bb fix: circular reference save, close #5140
commit 2ac099a37ac7bd74f0a98a6fdc42cc8527404144
Author: Jinzhu <wosmvp@gmail.com>
Date:   Thu Mar 17 23:49:21 2022 +0800

    Refactor #5140

commit 6e3ca2d1aa
Author: a631807682 <631807682@qq.com>
Date:   Sun Mar 13 12:52:08 2022 +0800

    test: add test for LoadOrStoreVisitMap

commit 9d5c68e410
Author: chenrui <chenrui@jingdaka.com>
Date:   Thu Mar 10 20:33:47 2022 +0800

    chore: add more comment

commit bfffefb179
Author: chenrui <chenrui@jingdaka.com>
Date:   Thu Mar 10 20:28:48 2022 +0800

    fix: should check values has been saved instead of rel.Name

commit e55cdfa4b3
Author: chenrui <chenrui@jingdaka.com>
Date:   Tue Mar 8 17:48:01 2022 +0800

    chore: go lint

commit fe4715c5bd
Author: chenrui <chenrui@jingdaka.com>
Date:   Tue Mar 8 17:27:24 2022 +0800

    chore: add test comment

commit 326862f3f8
Author: chenrui <chenrui@jingdaka.com>
Date:   Tue Mar 8 17:22:33 2022 +0800

    fix: circular reference save
2022-03-17 23:53:31 +08:00
Hasan f3e2da5ba3 Added offset when scanning the result back to struct, close #5143
commit 9a2058164d44c98d7b586b87bed1757f89d6fad7
Author: Jinzhu <wosmvp@gmail.com>
Date:   Thu Mar 17 22:34:19 2022 +0800

    Refactor #5143

commit c259de2176
Author: Hasan <mr.k779@outlook.com>
Date:   Mon Mar 14 20:04:01 2022 +0545

    Update scan_test.go

commit 09f127b491
Author: Hasan <mr.k779@outlook.com>
Date:   Mon Mar 14 19:23:47 2022 +0545

    Added test for scanning embedded data into structs

commit aeaca493cf
Author: Hasan <mr.k779@outlook.com>
Date:   Tue Mar 8 04:08:16 2022 +0600

    Added offset when scanning the result back to struct
2022-03-17 22:52:40 +08:00
Jinzhu 63ac66b569 Support default tag for time.Time 2022-03-17 11:34:27 +08:00
Jinzhu 6befa0c947 Refactor preload error check 2022-03-17 11:22:25 +08:00
Jinzhu 4e523499d1 Refactor Tx interface 2022-03-01 16:59:50 +08:00
lianghuan 996b96e812 Add TxConnPoolBeginner and Tx interface 2022-03-01 16:59:50 +08:00
Jinzhu e2e802b837 Refactor Scan 2022-02-28 13:00:30 +08:00
Jinzhu 530b0a12b4 Add fast path for ValueOf, ReflectValueOf 2022-02-27 22:16:31 +08:00
Jinzhu f2edda50e1 Refactor check missing where condition 2022-02-27 08:40:15 +08:00
chenrui 397b583b8e fix: query scanner in single column 2022-02-25 22:38:48 +08:00
jing1 3741f258d0
feat: support gob serialize (#5108) 2022-02-24 10:21:27 +08:00
Jinzhu b1201fce4e Fix update with customized time type, close #5101 2022-02-23 17:48:26 +08:00
codingxh 664c5fb767
strings.replace -> strings.replaceAll (#5095)
Co-authored-by: huquan<xxhh_quan_g@163.com>
2022-02-20 19:55:04 +08:00
Jinzhu 48ced75d1d Improve support for AutoMigrate 2022-02-19 23:42:20 +08:00
Jinzhu 0af95f509a Enhance migrator Columntype interface (#5088)
* Update Migrator ColumnType interface

* Update MigrateColumn Test

* Upgrade test drivers

* Fix typo
2022-02-19 17:02:53 +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
Jinzhu 4eeb839cea Better support Stringer when explain SQL 2022-02-09 15:17:25 +08:00
Jinzhu 416c4d0653 Test query with Or and soft delete 2022-02-08 16:31:24 +08:00
Jinzhu f19b84d104 Fix github action 2022-01-30 22:46:41 +08:00
Jinzhu 8d293d44dd Fix docker-compose test env for Mac M1 2022-01-30 22:05:38 +08:00
Ning 8c3673286d
preoload not allowd before count (#5023)
Co-authored-by: ningfei <accelerator314@outlook.com>
2022-01-30 18:17:06 +08:00
li-jin-gou c0bea447b9
fix: omit not work when use join (#5034) 2022-01-28 22:16:42 +08:00
Jinzhu cec0d32aec Support use clause.Expression as argument 2022-01-28 18:48:32 +08:00
dependabot[bot] e5894ca449
chore(deps): bump gorm.io/driver/mysql from 1.2.1 to 1.2.3 in /tests (#4987)
Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.2.1 to 1.2.3.
- [Release notes](https://github.com/go-gorm/mysql/releases)
- [Commits](https://github.com/go-gorm/mysql/compare/v1.2.1...v1.2.3)

---
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-01-12 13:11:57 +08:00
Jinzhu eae73624ad Fix return failed to begin transaction error when failed to start a transaction 2022-01-07 10:04:35 +08:00
kinggo 0df42e9afc
feat: add `Connection` to execute multiple commands in a single connection; (#4982) 2022-01-07 09:49:56 +08:00
halfcrazy f757b8fdc9
fix: auto migration column order unpredictable (#4980) 2022-01-06 18:55:20 +08:00
kinggo b47cf57f5e
ci: add gofumpt check in reviewdog (#4973) 2022-01-06 15:02:53 +08:00
kinggo 4dd2647967
Merge pull request #4964 from liweitingwt/f_test_error
improve the error handle in tests_test
2021-12-31 14:25:04 +08:00
kinggo 8dde09e0be
fix: generate sql incorrect when use soft_delete and only one OR (#4969)
* fix: generate sql incorrect when use soft_delete and only one OR
2021-12-30 11:47:14 +08:00
liweiting.wt b9667cb747 fix: fix the error handle in tests_test 2021-12-28 18:22:17 +08:00
Emre Güllü 2c3fc2db28
Fix: Where clauses with named arguments may cause generation of unintended queries (#4937) 2021-12-21 19:50:00 +08:00
Jinzhu adf8f70f06 Upgrade go.mod 2021-12-10 17:50:19 +08:00
kinggo e5bdd610c3
fix: save not use soft_delete (#4897)
* fix: Save not use soft_delete

* fix: save not use soft_delete

* fix: save not use soft_delete

* fix: save not use soft_delete

Co-authored-by: kinggo <>
2021-12-08 13:58:06 +08:00
Jinzhu 300a23fc31 Check rows.Close error, close #4891 2021-12-02 10:39:24 +08:00
Jinzhu 8627634959 Fix create associations with zero primary key, close #4890 2021-12-02 10:20:16 +08:00
Jinzhu 3a3b82263a Fix auto migration always alert table, close #4198 2021-11-29 20:24:16 +08:00
kinggo d8a710cba2
fix: count() when use group by and only find one record (#4885)
Co-authored-by: 李龙 <lilong.21@bytedance.com>
2021-11-29 20:14:23 +08:00
Jinzhu 27e2753c9d Fix create duplicated value when updating nested has many relationship, close #4796 2021-11-29 18:43:39 +08:00
Jinzhu 92d5a959a0 Fix tests 2021-11-29 15:16:57 +08:00
Jinzhu e1b4c066a8 Fix FullSaveAssociations, close #4874 2021-11-29 11:02:44 +08:00
Jinzhu b8f33a42a4
Add unused argument (#4871)
* Append unused argument to gorm statement
2021-11-23 17:11:52 +08:00
dependabot[bot] cff7845e58
Bump gorm.io/driver/mysql from 1.1.3 to 1.2.0 in /tests (#4856)
Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.1.3 to 1.2.0.
- [Release notes](https://github.com/go-gorm/mysql/releases)
- [Commits](https://github.com/go-gorm/mysql/compare/v1.1.3...v1.2.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-23 11:40:18 +08:00
dependabot[bot] 0f8e861597
Bump github.com/jinzhu/now from 1.1.2 to 1.1.3 in /tests (#4866)
Bumps [github.com/jinzhu/now](https://github.com/jinzhu/now) from 1.1.2 to 1.1.3.
- [Release notes](https://github.com/jinzhu/now/releases)
- [Commits](https://github.com/jinzhu/now/compare/v1.1.2...v1.1.3)

---
updated-dependencies:
- dependency-name: github.com/jinzhu/now
  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>
2021-11-23 11:40:03 +08:00
dino.ma 5e64ac7de9
feat(migrator,migrator/migrator.go,tests/migrate_test.go) : Get multiple data tables for migrator. (#4841)
* feat(migrator,migrator/migrator.go,tests/migrate_test.go) : Get multiple data tables for migrator.

* feat(migrator.go and migrator/migrator.go) : remove Table Struct replace with []string

* fix(migrator)  : Return all data tables

* Update migrator.go

* fix(migrator/migrator.go):remove var sql

* feat(migrate_test.go/go.mod):update sqlserver,sqlite,postgres,pq version and add getTables test

* fix(migrate_test.go):change GetTables Method Test,use intersection

Co-authored-by: dino.ma <mashengjie03@baidu.com>
2021-11-13 14:03:33 +08:00