Commit Graph

2388 Commits

Author SHA1 Message Date
Jinzhu da16a8aac6 Update updated_at when upserting with Create OnConflict 2021-09-17 15:29:49 +08:00
Jinzhu 12bbde89e6 Fix Scan with interface 2021-09-17 14:04:19 +08:00
Jinzhu 61b018cb94 Fix count with selected * 2021-09-16 11:17:54 +08:00
Jinzhu d41fb3acdc Refactor dummy driver QuoteTo method 2021-09-11 16:22:35 +08:00
Jinzhu 04f049c1da Add tests for RowsAffected 2021-09-09 11:22:55 +08:00
Jinzhu a16db07945 Refactor Join ON 2021-09-07 21:21:44 +08:00
Jinzhu ba16b2368f
Refactor update record (#4679) 2021-09-07 20:04:54 +08:00
Jinzhu 6c94b07e98 try to fix fatal error: concurrent map read and map write 2021-09-07 15:30:14 +08:00
Jinzhu 3b6a7c8aec Update sqlserver driver 2021-09-07 12:01:19 +08:00
Adrien Carreira d047f854e6 PR Comments 2021-09-06 20:13:20 +08:00
Adrien Carreira c301aeb524 Refactor for readability 2021-09-06 20:13:20 +08:00
Adrien Carreira 52cc438d07 JoinsOn unit test + use all primary keys 2021-09-06 20:13:20 +08:00
Adrien Carreira 895c1178a0 Proposal, Add Specific on for Joins queries 2021-09-06 20:13:20 +08:00
riverchu eaa63d15e7 feat: copy dest fields to model struct 2021-09-06 20:13:20 +08:00
riverchu 4581e8b590 test: update Save test 2021-09-06 20:13:20 +08:00
riverchu c898622791 test: add testcase in TestSave 2021-09-06 20:13:20 +08:00
riverchu 1d9e563023 style: prepose error judgement 2021-09-06 20:13:20 +08:00
dependabot[bot] a89d4d8fd5
Bump github.com/lib/pq from 1.10.2 to 1.10.3 in /tests (#4676)
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.10.2 to 1.10.3.
- [Release notes](https://github.com/lib/pq/releases)
- [Commits](https://github.com/lib/pq/compare/v1.10.2...v1.10.3)

---
updated-dependencies:
- dependency-name: github.com/lib/pq
  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-09-06 16:26:14 +08:00
dependabot[bot] 5f019f74bf
Bump gorm.io/gorm from 1.21.13 to 1.21.14 in /tests (#4655)
Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.21.13 to 1.21.14.
- [Release notes](https://github.com/go-gorm/gorm/releases)
- [Commits](https://github.com/go-gorm/gorm/compare/v1.21.13...v1.21.14)

---
updated-dependencies:
- dependency-name: gorm.io/gorm
  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-09-03 17:47:50 +08:00
jxlwqq 15188cf409
Add Go 1.17 (#4666) 2021-09-03 17:47:32 +08:00
Jinzhu 3a8c250180 Refactor calc associations onConflictOption 2021-08-26 13:37:49 +08:00
zkqiang 74746211b8 Test update association with non-updatable 2021-08-26 13:37:49 +08:00
zkqiang e81833fd11 Fix onConflict with non-updatable in associations 2021-08-26 13:37:49 +08:00
Jinzhu f21e35f7c5 Fix table not supported error when using unexpected table name 2021-08-26 13:14:16 +08:00
dependabot[bot] 0934b10856
Bump gorm.io/driver/sqlserver from 1.0.7 to 1.0.8 in /tests (#4631)
Bumps [gorm.io/driver/sqlserver](https://github.com/go-gorm/sqlserver) from 1.0.7 to 1.0.8.
- [Release notes](https://github.com/go-gorm/sqlserver/releases)
- [Commits](https://github.com/go-gorm/sqlserver/compare/v1.0.7...v1.0.8)

---
updated-dependencies:
- dependency-name: gorm.io/driver/sqlserver
  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-08-23 15:30:02 +08:00
Sec Cake 093694fbf2
Fix extra 'AND' when len(values) == 0 ON IN.NegationBuild() (#4618) 2021-08-20 18:06:48 +08:00
dependabot[bot] 7a53d8e46b
Bump gorm.io/driver/mysql from 1.1.1 to 1.1.2 in /tests (#4615)
Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.1.1 to 1.1.2.
- [Release notes](https://github.com/go-gorm/mysql/releases)
- [Commits](https://github.com/go-gorm/mysql/compare/v1.1.1...v1.1.2)

---
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>
2021-08-20 17:52:56 +08:00
dependabot[bot] e076e9e0fb
Bump gorm.io/gorm from 1.21.12 to 1.21.13 in /tests (#4616)
Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.21.12 to 1.21.13.
- [Release notes](https://github.com/go-gorm/gorm/releases)
- [Commits](https://github.com/go-gorm/gorm/compare/v1.21.12...v1.21.13)

---
updated-dependencies:
- dependency-name: gorm.io/gorm
  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-08-20 17:52:48 +08:00
River 1bb0d8732d
feat: count accpet `db`.`table` (#4626)
* feat: count accpet `db`.`table`

* fix: logic fix
2021-08-20 17:37:21 +08:00
River 25f561a742
feat: QuoteTo accept clause.Expr (#4621)
* feat: QuoteTo accept clause.Expr

* test: update Expr build test
2021-08-19 14:33:18 +08:00
Jinzhu 2b2f6e77af Add SchemaName to NamingStrategy 2021-08-11 16:20:29 +08:00
Sungyun Hur a83d25e25e
chore(logger): explicitly set config of Default Logger (#4605) 2021-08-11 11:49:46 +08:00
张凯强 21e85b89d6
Fix create with ignore migration (#4571) 2021-08-09 13:23:44 +08:00
SmallTianTian 82fe815303
fix: table couln't be reentrant (#4556) 2021-08-09 13:20:22 +08:00
Matthieu MOREL cbe72751ac
Update Dependencies (#4582)
* Create dependabot.yml

* Bump reviewdog/action-golangci-lint from 1 to 2 (#1)

Bumps [reviewdog/action-golangci-lint](https://github.com/reviewdog/action-golangci-lint) from 1 to 2.
- [Release notes](https://github.com/reviewdog/action-golangci-lint/releases)
- [Commits](https://github.com/reviewdog/action-golangci-lint/compare/v1...v2)

---
updated-dependencies:
- dependency-name: reviewdog/action-golangci-lint
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump actions/stale from 3.0.7 to 4 (#2)

Bumps [actions/stale](https://github.com/actions/stale) from 3.0.7 to 4.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v3.0.7...v4)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump gorm.io/gorm from 1.21.9 to 1.21.12 in /tests (#3)

Bumps [gorm.io/gorm](https://github.com/go-gorm/gorm) from 1.21.9 to 1.21.12.
- [Release notes](https://github.com/go-gorm/gorm/releases)
- [Commits](https://github.com/go-gorm/gorm/compare/v1.21.9...v1.21.12)

---
updated-dependencies:
- dependency-name: gorm.io/gorm
  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>

* Bump gorm.io/driver/mysql from 1.0.5 to 1.1.1 in /tests (#4)

Bumps [gorm.io/driver/mysql](https://github.com/go-gorm/mysql) from 1.0.5 to 1.1.1.
- [Release notes](https://github.com/go-gorm/mysql/releases)
- [Commits](https://github.com/go-gorm/mysql/compare/v1.0.5...v1.1.1)

---
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>

* Bump github.com/lib/pq from 1.6.0 to 1.10.2 in /tests (#5)

Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.6.0 to 1.10.2.
- [Release notes](https://github.com/lib/pq/releases)
- [Commits](https://github.com/lib/pq/compare/v1.6.0...v1.10.2)

---
updated-dependencies:
- dependency-name: github.com/lib/pq
  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>

* Bump github.com/google/uuid from 1.2.0 to 1.3.0 in /tests (#6)

Bumps [github.com/google/uuid](https://github.com/google/uuid) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/google/uuid/releases)
- [Commits](https://github.com/google/uuid/compare/v1.2.0...v1.3.0)

---
updated-dependencies:
- dependency-name: github.com/google/uuid
  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>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-09 13:16:25 +08:00
Walter Scheper a870486c4f
Do not emit ORDER BY for empty values (#4592)
This restores the behavior from gorm v1, where calling `DB.Order` with
an empty string, nil, or any unexpected type is a no-op.
2021-08-09 13:14:23 +08:00
heige 9e5a4e30b4
Fix migrator GuessConstraintAndTable method for return value for *schema.Check (#4527) 2021-08-03 11:40:57 +08:00
heige 413fe587c6
Optimize migrator.go MigrateColumn and ColumnTypes func. (#4532) 2021-08-02 18:44:10 +08:00
daheige 7a49629fd1 optimize Parse func for fieldValue.Interface 2021-07-28 19:00:34 +08:00
daheige 41ac73b6a1 update comment for ConvertSliceOfMapToValuesForCreate func 2021-07-28 18:56:39 +08:00
Jason Lee 3e15478534
Merge pull request #4530 from daheige/optimize-setupValuerAndSetter
optimize setupValuerAndSetter func
2021-07-28 18:51:09 +08:00
heige 5115813c50
Fix preload fmt.Errorf formatter (#4531) 2021-07-28 18:50:08 +08:00
s-takehana 2202e99cbf
Fix create index with comments in MySQL (#4521)
* Fix create index with comments in MySQL

* Fix tests
2021-07-18 11:47:44 +08:00
daheige a70254609d optimize setupValuerAndSetter func 2021-07-14 22:03:17 +08:00
Jinzhu 74752018dc Fix hang when closing a prepared statement 2021-07-14 18:35:10 +08:00
River ac97aec513
New Comma Expression (#4524)
* Add new comma expression

* Add comma expression unit test
2021-07-14 15:51:24 +08:00
Jinzhu d4f3c109d6 Fix OnConflict with one column, close #4370 2021-07-13 21:29:31 +08:00
Jinzhu 83530ec659 Fix delete order by clause when counting, close #4478 2021-07-13 21:17:43 +08:00
Jinzhu 52b72d7ef2 Add error explanations when preloading assocations w/o foreign fields, close #4356 2021-07-13 21:00:13 +08:00
Jinzhu b13732c450 Fix invalid preload SQL when no data found, close #4443 2021-07-13 20:23:05 +08:00