Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch to latest #31

Merged
merged 87 commits into from
Feb 15, 2022
Merged

Fetch to latest #31

merged 87 commits into from
Feb 15, 2022

Conversation

freehere107
Copy link
Collaborator

No description provided.

jinzhu and others added 30 commits September 11, 2021 16:22
Bumps [gorm.io/driver/sqlite](https://github.com/go-gorm/sqlite) from 1.1.4 to 1.1.5.
- [Release notes](https://github.com/go-gorm/sqlite/releases)
- [Commits](go-gorm/sqlite@v1.1.4...v1.1.5)

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

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [gorm.io/driver/postgres](https://github.com/go-gorm/postgres) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/go-gorm/postgres/releases)
- [Commits](go-gorm/postgres@v1.1.0...v1.1.1)

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

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Allow the sql stmt terminator ";" at the end of a named parameter.

Example: select * from table_name where name == @name;
* fix: QuoteTo not fully support raw mode

* fix: table alias without AS

* test: clause.Column/Table quote test

* fix: revert table alias quote
Bumps [gorm.io/driver/postgres](https://github.com/go-gorm/postgres) from 1.1.1 to 1.1.2.
- [Release notes](https://github.com/go-gorm/postgres/releases)
- [Commits](go-gorm/postgres@v1.1.1...v1.1.2)

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

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fixed belongs_to & has_one reversed if field same

* hasmany same foreign key bug fixed and test added

* belongsToSameForeignKey fixed and reverted old fix
…tag (#4738)

* fix:update miss where condition

* fix:rename test case
* fixed:create nil pointer

* fixed:panic when create value from nil struct pointer.
Makes it the default behavior to convert SQL null values to zero
values for model fields which are not pointers.
fix: automigrate error caused by indexes while using dynamic table name
* Refactor ParseWithSchemaTable method and improve test.

* Fix schema.ParseWithSchemaTable method for only use schemaTable in migrator and improve test.

* Rename `schemaTable` to `specialTableName` for clearly argument.
jinzhu and others added 29 commits December 2, 2021 10:39
* 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 <>
* 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
* modify unscoped judge

* modify unscoped judge

Co-authored-by: liweiting <[email protected]>
* fix: generate sql incorrect when use soft_delete and only one OR
improve the error handle in tests_test
* time.Time, []byte type add alias support

* reformat
…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](go-gorm/mysql@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] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Added two comments to describe FirstOrInit and FirstOrCreate methods.
* fix: replace empty name result in panic

* fix: replace empty table name result in panic
@freehere107 freehere107 merged commit d8ad9b1 into itering:master Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.