Jinzhu
2c9e215396
Update go.mod
2022-02-16 15:29:12 +08:00
Jinzhu
c59748da97
Add unixtime serializer
2022-02-16 15:21:58 +08:00
Jinzhu
992042b46e
Test serializer tag
2022-02-15 22:50:31 +08:00
Jinzhu
379ce9f27b
Fix JSONSerializer for sqlserver
2022-02-15 21:43:53 +08:00
Jinzhu
94d502b71b
Fix JSONSerializer for postgres
2022-02-15 21:37:28 +08:00
Jinzhu
a1dc940af3
Finish Serializer
2022-02-15 21:29:29 +08:00
Jinzhu
5f6d85c00a
Add serializer test
2022-02-15 20:47:22 +08:00
Jinzhu
0b039497c4
Add Serializer Value method
2022-02-15 20:31:28 +08:00
Jinzhu
bf85076f0e
Add Serializer Scan support
2022-02-15 20:14:57 +08:00
Jinzhu
6393ad5222
Add poolInitializer
2022-02-15 15:38:53 +08:00
Jinzhu
20abf83a21
Fix pool manager
2022-02-15 15:08:43 +08:00
Jinzhu
744c91c9a7
Add pool manager
2022-02-15 13:53:46 +08:00
Jinzhu
7e37f3ad75
Fix test
2022-02-14 23:26:09 +08:00
Jinzhu
07f0438435
Add sync.Pool
2022-02-14 19:31:32 +08:00
Jinzhu
fb52b97363
Refactor setter, valuer
2022-02-14 17:25:00 +08:00
Jinzhu
69b851ed95
Refactor gorm field
2022-02-14 15:51:32 +08:00
Jinzhu
3c77eb0bb0
Add Serializer Interface
2022-02-10 20:11:37 +08:00
Jinzhu
1b6cc25e19
Merge branch 'field_context'
2022-02-10 15:02:22 +08:00
Jinzhu
211aaed6c4
Add Serializer
2022-02-10 15:01:02 +08:00
Jinzhu
a0aceeb33e
Migrator AlterColumn with full data type
2022-02-10 10:40:48 +08:00
Jinzhu
df2365057b
Remove uncessary switch case
2022-02-09 17:23:16 +08:00
Jinzhu
4eeb839cea
Better support Stringer when explain SQL
2022-02-09 15:17:25 +08:00
li-jin-gou
d22215129e
fix: replace empty table name result in panic ( #5048 )
...
* fix: replace empty name result in panic
* fix: replace empty table name result in panic
2022-02-08 17:06:10 +08:00
Jinzhu
416c4d0653
Test query with Or and soft delete
2022-02-08 16:31:24 +08:00
Jason Lee
93b1a6f7ea
Merge pull request #5043 from Saurabh-Thakre/patch-2
2022-02-04 22:31:21 +08:00
Saurabh Thakre
581a879bf1
Added comments to existing methods
...
Added two comments to describe FirstOrInit and FirstOrCreate methods.
2022-01-31 17:26:28 +05:30
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
98c4b78e4d
Add Session Initialized option
2022-01-28 19:26:10 +08:00
Jinzhu
cec0d32aec
Support use clause.Expression as argument
2022-01-28 18:48:32 +08:00
Jinzhu
061aea8d7e
Update GormFieldValuer
2022-01-20 21:30:59 +08:00
Jinzhu
0ca42129fa
Update context
2022-01-20 21:13:52 +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>
v1.22.5
2022-01-12 13:11:57 +08:00
piyongcai
a0d6ff1fea
time.Time, []byte type add alias support. (rebase master) ( #4992 )
...
* time.Time, []byte type add alias support
* reformat
2022-01-12 13:11:40 +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
liweitingwt
24026bf1fe
modify unscoped judge ( #4929 )
...
* modify unscoped judge
* modify unscoped judge
Co-authored-by: liweiting <liweiting1995@gmail.com>
2021-12-16 10:41:34 +08:00
Jinzhu
adf8f70f06
Upgrade go.mod
2021-12-10 17:50:19 +08:00
piyongcai
380cc64ff5
fix type alias AutoMigrate bug(Add Test Case) ( #4888 )
...
* fix type alias AutoMigrate bug. eg
```go
package main
type IDer interface{ GetID() int64 }
// ID will add some method to implement some interface eg: GetID
type ID int64
func (z ID) GetID() int64 { return int64(z) }
type Test struct {
ID
Code string `gorm:"size:50"`
Name string `gorm:"size:50"`
}
func main() {
db, err := gorm.Open(postgres.New(postgres.Config{
DSN: `dsn`,
PreferSimpleProtocol: false,
}), &gorm.Config{
Logger: logger.Default.LogMode(logger.Info),
SkipDefaultTransaction: true,
})
if err != nil {
log.Fatal(err)
}
if err = db.AutoMigrate(&Test{}); err != nil {
// invalid embedded struct for Test's field ID, should be struct, but got main.ID
log.Fatal(err)
}
}
```
* fix type alias AutoMigrate bug. eg
```go
package main
type IDer interface{ GetID() int64 }
// ID will add some method to implement some interface eg: GetID
type ID int64
func (z ID) GetID() int64 { return int64(z) }
type Test struct {
ID
Code string `gorm:"size:50"`
Name string `gorm:"size:50"`
}
func main() {
db, err := gorm.Open(postgres.New(postgres.Config{
DSN: `dsn`,
PreferSimpleProtocol: false,
}), &gorm.Config{
Logger: logger.Default.LogMode(logger.Info),
SkipDefaultTransaction: true,
})
if err != nil {
log.Fatal(err)
}
if err = db.AutoMigrate(&Test{}); err != nil {
// invalid embedded struct for Test's field ID, should be struct, but got main.ID
log.Fatal(err)
}
}
```
* Add typealis test.
* try to fix golangci-lint
2021-12-10 17:45:36 +08:00
Matthieu MOREL
2a578d767f
Use Golangci configuration file ( #4896 )
2021-12-10 17:44:11 +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