mirror of https://github.com/go-gorm/gorm.git
Rename package name
This commit is contained in:
parent
5ecbf25b22
commit
e986371a42
|
@ -2,14 +2,14 @@
|
|||
|
||||
The fantastic ORM library for Golang, aims to be developer friendly.
|
||||
|
||||
[![go report card](https://goreportcard.com/badge/github.com/jinzhu/gorm "go report card")](https://goreportcard.com/report/github.com/jinzhu/gorm)
|
||||
[![go report card](https://goreportcard.com/badge/gorm.io/gorm "go report card")](https://goreportcard.com/report/gorm.io/gorm)
|
||||
[![wercker status](https://app.wercker.com/status/8596cace912c9947dd9c8542ecc8cb8b/s/master "wercker status")](https://app.wercker.com/project/byKey/8596cace912c9947dd9c8542ecc8cb8b)
|
||||
[![codecov](https://codecov.io/gh/jinzhu/gorm/branch/master/graph/badge.svg)](https://codecov.io/gh/jinzhu/gorm)
|
||||
[![Join the chat at https://gitter.im/jinzhu/gorm](https://img.shields.io/gitter/room/jinzhu/gorm.svg)](https://gitter.im/jinzhu/gorm?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[![Open Collective Backer](https://opencollective.com/gorm/tiers/backer/badge.svg?label=backer&color=brightgreen "Open Collective Backer")](https://opencollective.com/gorm)
|
||||
[![Open Collective Sponsor](https://opencollective.com/gorm/tiers/sponsor/badge.svg?label=sponsor&color=brightgreen "Open Collective Sponsor")](https://opencollective.com/gorm)
|
||||
[![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)
|
||||
[![GoDoc](https://godoc.org/github.com/jinzhu/gorm?status.svg)](https://godoc.org/github.com/jinzhu/gorm)
|
||||
[![GoDoc](https://godoc.org/gorm.io/gorm?status.svg)](https://godoc.org/gorm.io/gorm)
|
||||
|
||||
## Overview
|
||||
|
||||
|
@ -39,3 +39,4 @@ The fantastic ORM library for Golang, aims to be developer friendly.
|
|||
© Jinzhu, 2013~time.Now
|
||||
|
||||
Released under the [MIT License](https://github.com/jinzhu/gorm/blob/master/License)
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ import (
|
|||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"github.com/jinzhu/gorm/utils"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
"gorm.io/gorm/utils"
|
||||
)
|
||||
|
||||
// Association Mode contains some helper methods to handle relationship things easily.
|
||||
|
|
|
@ -7,9 +7,9 @@ import (
|
|||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm/logger"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"github.com/jinzhu/gorm/utils"
|
||||
"gorm.io/gorm/logger"
|
||||
"gorm.io/gorm/schema"
|
||||
"gorm.io/gorm/utils"
|
||||
)
|
||||
|
||||
func initializeCallbacks(db *DB) *callbacks {
|
||||
|
|
|
@ -3,10 +3,10 @@ package callbacks
|
|||
import (
|
||||
"reflect"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"github.com/jinzhu/gorm/utils"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
"gorm.io/gorm/utils"
|
||||
)
|
||||
|
||||
func SaveBeforeAssociations(db *gorm.DB) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package callbacks
|
||||
|
||||
import (
|
||||
"github.com/jinzhu/gorm"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
|
|
|
@ -3,9 +3,9 @@ package callbacks
|
|||
import (
|
||||
"reflect"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
func BeforeCreate(db *gorm.DB) {
|
||||
|
|
|
@ -3,9 +3,9 @@ package callbacks
|
|||
import (
|
||||
"reflect"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
func BeforeDelete(db *gorm.DB) {
|
||||
|
|
|
@ -3,8 +3,8 @@ package callbacks
|
|||
import (
|
||||
"sort"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
// SelectAndOmitColumns get select and omit columns, select -> true, omit -> false
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package callbacks
|
||||
|
||||
import "github.com/jinzhu/gorm"
|
||||
import "gorm.io/gorm"
|
||||
|
||||
type beforeSaveInterface interface {
|
||||
BeforeSave(*gorm.DB) error
|
||||
|
|
|
@ -3,10 +3,10 @@ package callbacks
|
|||
import (
|
||||
"reflect"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"github.com/jinzhu/gorm/utils"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
"gorm.io/gorm/utils"
|
||||
)
|
||||
|
||||
func preload(db *gorm.DB, rels []*schema.Relationship, conds []interface{}) {
|
||||
|
|
|
@ -6,9 +6,9 @@ import (
|
|||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
func Query(db *gorm.DB) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package callbacks
|
||||
|
||||
import (
|
||||
"github.com/jinzhu/gorm"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func RawExec(db *gorm.DB) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package callbacks
|
||||
|
||||
import (
|
||||
"github.com/jinzhu/gorm"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func RowQuery(db *gorm.DB) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package callbacks
|
||||
|
||||
import (
|
||||
"github.com/jinzhu/gorm"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func BeginTransaction(db *gorm.DB) {
|
||||
|
|
|
@ -4,9 +4,9 @@ import (
|
|||
"reflect"
|
||||
"sort"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
func SetupUpdateReflectValue(db *gorm.DB) {
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/utils"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/utils"
|
||||
)
|
||||
|
||||
// Model specify the model you would like to run db operations
|
||||
|
|
|
@ -4,10 +4,10 @@ import (
|
|||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
"gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func BenchmarkSelect(b *testing.B) {
|
||||
|
|
|
@ -6,10 +6,10 @@ import (
|
|||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
"gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
var db, _ = gorm.Open(tests.DummyDialector{}, nil)
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
func TestDelete(t *testing.T) {
|
||||
|
|
|
@ -5,10 +5,10 @@ import (
|
|||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
"gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestExpr(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
func TestFrom(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
func TestGroupBy(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
func TestInsert(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
func TestLimit(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
func TestFor(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
func TestOrderBy(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
func TestReturning(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
func TestSelect(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
func TestSet(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
func TestUpdate(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
func TestValues(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
func TestWhere(t *testing.T) {
|
||||
|
|
|
@ -4,10 +4,10 @@ import (
|
|||
"reflect"
|
||||
"sort"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/callbacks"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/callbacks"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
func Create(db *gorm.DB) {
|
||||
|
|
|
@ -3,9 +3,9 @@ package mssql
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/migrator"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/migrator"
|
||||
)
|
||||
|
||||
type Migrator struct {
|
||||
|
|
|
@ -7,12 +7,12 @@ import (
|
|||
"strconv"
|
||||
|
||||
_ "github.com/denisenkom/go-mssqldb"
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/callbacks"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/logger"
|
||||
"github.com/jinzhu/gorm/migrator"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/callbacks"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/logger"
|
||||
"gorm.io/gorm/migrator"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
type Dialector struct {
|
||||
|
|
|
@ -3,9 +3,9 @@ package mysql
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/migrator"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/migrator"
|
||||
)
|
||||
|
||||
type Migrator struct {
|
||||
|
|
|
@ -6,12 +6,12 @@ import (
|
|||
"math"
|
||||
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/callbacks"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/logger"
|
||||
"github.com/jinzhu/gorm/migrator"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/callbacks"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/logger"
|
||||
"gorm.io/gorm/migrator"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
type Dialector struct {
|
||||
|
|
|
@ -3,10 +3,10 @@ package postgres
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/migrator"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/migrator"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
type Migrator struct {
|
||||
|
|
|
@ -6,12 +6,12 @@ import (
|
|||
"regexp"
|
||||
"strconv"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/callbacks"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/logger"
|
||||
"github.com/jinzhu/gorm/migrator"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/callbacks"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/logger"
|
||||
"gorm.io/gorm/migrator"
|
||||
"gorm.io/gorm/schema"
|
||||
_ "github.com/lib/pq"
|
||||
)
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/migrator"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/migrator"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
type Migrator struct {
|
||||
|
|
|
@ -3,12 +3,12 @@ package sqlite
|
|||
import (
|
||||
"database/sql"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/callbacks"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/logger"
|
||||
"github.com/jinzhu/gorm/migrator"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/callbacks"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/logger"
|
||||
"gorm.io/gorm/migrator"
|
||||
"gorm.io/gorm/schema"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"gorm.io/gorm/clause"
|
||||
)
|
||||
|
||||
// Create insert the value into database
|
||||
|
|
7
go.mod
7
go.mod
|
@ -1,4 +1,4 @@
|
|||
module github.com/jinzhu/gorm
|
||||
module gorm.io/gorm
|
||||
|
||||
go 1.14
|
||||
|
||||
|
@ -6,8 +6,9 @@ require (
|
|||
github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc
|
||||
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5
|
||||
github.com/go-sql-driver/mysql v1.5.0
|
||||
github.com/jinzhu/inflection v1.0.0
|
||||
github.com/jinzhu/now v1.1.1
|
||||
gorm.io/gorm v1.9.12
|
||||
gorm.io/inflection v1.0.0
|
||||
gorm.io/now v1.1.1
|
||||
github.com/lib/pq v1.1.1
|
||||
github.com/mattn/go-sqlite3 v2.0.1+incompatible
|
||||
)
|
||||
|
|
6
gorm.go
6
gorm.go
|
@ -6,9 +6,9 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/logger"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/logger"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
// Config GORM config
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"context"
|
||||
"database/sql"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
// Dialector GORM database dialector
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm/utils"
|
||||
"gorm.io/gorm/utils"
|
||||
)
|
||||
|
||||
// Colors
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"regexp"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/logger"
|
||||
"github.com/jinzhu/now"
|
||||
"gorm.io/gorm/logger"
|
||||
"gorm.io/now"
|
||||
)
|
||||
|
||||
func TestExplainSQL(t *testing.T) {
|
||||
|
|
|
@ -6,9 +6,9 @@ import (
|
|||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
// Migrator m struct
|
||||
|
|
2
scan.go
2
scan.go
|
@ -5,7 +5,7 @@ import (
|
|||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
func Scan(rows *sql.Rows, db *DB, initialized bool) {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
type UserWithCallback struct {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
type UserCheck struct {
|
||||
|
|
|
@ -10,8 +10,8 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm/utils"
|
||||
"github.com/jinzhu/now"
|
||||
"gorm.io/gorm/utils"
|
||||
"gorm.io/now"
|
||||
)
|
||||
|
||||
type DataType string
|
||||
|
|
|
@ -7,9 +7,9 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/schema"
|
||||
"gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestFieldValuerAndSetter(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
type UserIndex struct {
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"database/sql"
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"sync"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/jinzhu/inflection"
|
||||
"gorm.io/inflection"
|
||||
)
|
||||
|
||||
// Namer namer interface
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/inflection"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/inflection"
|
||||
)
|
||||
|
||||
// RelationshipType relationship type
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
func checkStructRelation(t *testing.T, data interface{}, relations ...Relation) {
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
"reflect"
|
||||
"sync"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/logger"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/logger"
|
||||
)
|
||||
|
||||
// ErrUnsupportedDataType unsupported data type
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm/schema"
|
||||
"gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func checkSchema(t *testing.T, s *schema.Schema, v schema.Schema, primaryFields []string) {
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm/schema"
|
||||
"gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestParseSchema(t *testing.T) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/jinzhu/gorm/utils"
|
||||
"gorm.io/gorm/utils"
|
||||
)
|
||||
|
||||
func ParseTagSetting(str string, sep string) map[string]string {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"database/sql/driver"
|
||||
"reflect"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
type DeletedAt sql.NullTime
|
||||
|
|
|
@ -10,8 +10,8 @@ import (
|
|||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
// Statement statement
|
||||
|
|
|
@ -3,7 +3,7 @@ package tests_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestBelongsToAssociation(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package tests_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestHasManyAssociation(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package tests_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestHasOneAssociation(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package tests_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestMany2ManyAssociation(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package tests_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func AssertAssociationCount(t *testing.T, data interface{}, name string, result int64, reason string) {
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func assertCallbacks(v interface{}, fnames []string) (result bool, msg string) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestCount(t *testing.T) {
|
||||
|
|
|
@ -4,9 +4,9 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
"github.com/jinzhu/now"
|
||||
"gorm.io/gorm"
|
||||
. "gorm.io/gorm/tests"
|
||||
"gorm.io/now"
|
||||
)
|
||||
|
||||
func TestCreate(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestCustomizeColumn(t *testing.T) {
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestDelete(t *testing.T) {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package tests
|
||||
|
||||
import (
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
"github.com/jinzhu/gorm/logger"
|
||||
"github.com/jinzhu/gorm/schema"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/logger"
|
||||
"gorm.io/gorm/schema"
|
||||
)
|
||||
|
||||
type DummyDialector struct {
|
||||
|
|
|
@ -3,8 +3,8 @@ package tests_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestEmbeddedStruct(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package tests_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestGroupBy(t *testing.T) {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
type Product struct {
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
type Person struct {
|
||||
|
|
|
@ -4,8 +4,8 @@ import (
|
|||
"sort"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestJoins(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package tests_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestMigrate(t *testing.T) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"database/sql"
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// User has one `Account` (has one), many `Pets` (has many) and `Toys` (has many - polymorphic)
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"sort"
|
||||
"testing"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
type Blog struct {
|
||||
|
|
|
@ -3,7 +3,7 @@ package tests_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
type Hamster struct {
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
type Animal struct {
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func toJSONString(v interface{}) []byte {
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"strconv"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm/clause"
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm/clause"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestNestedPreload(t *testing.T) {
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestFind(t *testing.T) {
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestScan(t *testing.T) {
|
||||
|
|
|
@ -10,8 +10,8 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestScannerValuer(t *testing.T) {
|
||||
|
|
|
@ -3,8 +3,8 @@ package tests_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func NameIn1And2(d *gorm.DB) *gorm.DB {
|
||||
|
|
|
@ -3,7 +3,7 @@ package tests_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestSoftDelete(t *testing.T) {
|
||||
|
|
|
@ -3,8 +3,8 @@ package tests_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestRow(t *testing.T) {
|
||||
|
|
|
@ -7,12 +7,12 @@ import (
|
|||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/jinzhu/gorm/dialects/mssql"
|
||||
"github.com/jinzhu/gorm/dialects/mysql"
|
||||
"github.com/jinzhu/gorm/dialects/postgres"
|
||||
"github.com/jinzhu/gorm/dialects/sqlite"
|
||||
"github.com/jinzhu/gorm/logger"
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/dialects/mssql"
|
||||
"gorm.io/gorm/dialects/mysql"
|
||||
"gorm.io/gorm/dialects/postgres"
|
||||
"gorm.io/gorm/dialects/sqlite"
|
||||
"gorm.io/gorm/logger"
|
||||
)
|
||||
|
||||
var DB *gorm.DB
|
||||
|
|
|
@ -5,8 +5,8 @@ import (
|
|||
"errors"
|
||||
"testing"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
"gorm.io/gorm"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestTransaction(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package tests_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestUpdateBelongsTo(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package tests_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestUpdateHasManyAssociations(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package tests_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestUpdateHasOne(t *testing.T) {
|
||||
|
|
|
@ -3,7 +3,7 @@ package tests_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/jinzhu/gorm/tests"
|
||||
. "gorm.io/gorm/tests"
|
||||
)
|
||||
|
||||
func TestUpdateMany2ManyAssociations(t *testing.T) {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue