using new organization

This commit is contained in:
Ming Deng
2020-12-13 23:09:19 +08:00
parent 093f976365
commit a70f7fc920
253 changed files with 504 additions and 503 deletions

View File

@@ -1,6 +1,6 @@
# beego orm
[![Build Status](https://drone.io/github.com/astaxie/beego/status.png)](https://drone.io/github.com/astaxie/beego/latest)
[![Build Status](https://drone.io/github.com/beego/beego/status.png)](https://drone.io/github.com/beego/beego/latest)
A powerful orm framework for go.
@@ -27,7 +27,7 @@ more features please read the docs
**Install:**
go get github.com/astaxie/beego/orm
go get github.com/beego/beego/orm
## Changelog
@@ -45,7 +45,7 @@ package main
import (
"fmt"
"github.com/astaxie/beego/orm"
"github.com/beego/beego/orm"
_ "github.com/go-sql-driver/mysql" // import your used driver
)

View File

@@ -22,7 +22,7 @@ import (
"strings"
"time"
"github.com/astaxie/beego/client/orm/hints"
"github.com/beego/beego/client/orm/hints"
)
const (

View File

@@ -18,7 +18,7 @@ import (
"fmt"
"strings"
"github.com/astaxie/beego/client/orm/hints"
"github.com/beego/beego/client/orm/hints"
)
// oracle operators.

View File

@@ -21,7 +21,7 @@ import (
"strings"
"time"
"github.com/astaxie/beego/client/orm/hints"
"github.com/beego/beego/client/orm/hints"
)
// sqlite operators.

View File

@@ -18,7 +18,7 @@ import (
"context"
"database/sql"
"github.com/astaxie/beego/core/utils"
"github.com/beego/beego/core/utils"
)
// DoNothingOrm won't do anything, usually you use this to custom your mock Ormer implementation

View File

@@ -19,10 +19,10 @@ import (
"reflect"
"strings"
"github.com/astaxie/beego/core/logs"
"github.com/beego/beego/core/logs"
"github.com/astaxie/beego/client/orm"
"github.com/astaxie/beego/core/bean"
"github.com/beego/beego/client/orm"
"github.com/beego/beego/core/bean"
)
// DefaultValueFilterChainBuilder only works for InsertXXX method,

View File

@@ -19,7 +19,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/astaxie/beego/client/orm"
"github.com/beego/beego/client/orm"
)
func TestDefaultValueFilterChainBuilder_FilterChain(t *testing.T) {

View File

@@ -20,7 +20,7 @@ import (
"github.com/opentracing/opentracing-go"
"github.com/astaxie/beego/client/orm"
"github.com/beego/beego/client/orm"
)
// FilterChainBuilder provides an extension point

View File

@@ -21,7 +21,7 @@ import (
"github.com/opentracing/opentracing-go"
"github.com/astaxie/beego/client/orm"
"github.com/beego/beego/client/orm"
)
func TestFilterChainBuilder_FilterChain(t *testing.T) {

View File

@@ -22,7 +22,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/astaxie/beego/client/orm"
"github.com/beego/beego/client/orm"
)
// FilterChainBuilder is an extension point,

View File

@@ -21,7 +21,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/astaxie/beego/client/orm"
"github.com/beego/beego/client/orm"
)
func TestFilterChainBuilder_FilterChain1(t *testing.T) {

View File

@@ -20,7 +20,7 @@ import (
"reflect"
"time"
"github.com/astaxie/beego/core/utils"
"github.com/beego/beego/core/utils"
)
const (

View File

@@ -21,7 +21,7 @@ import (
"sync"
"testing"
"github.com/astaxie/beego/core/utils"
"github.com/beego/beego/core/utils"
"github.com/stretchr/testify/assert"
)

View File

@@ -15,7 +15,7 @@
package hints
import (
"github.com/astaxie/beego/core/utils"
"github.com/beego/beego/core/utils"
)
const (

View File

@@ -17,7 +17,7 @@ package migration
import (
"fmt"
"github.com/astaxie/beego/core/logs"
"github.com/beego/beego/core/logs"
)
// Index struct defines the structure of Index Columns

View File

@@ -33,8 +33,8 @@ import (
"strings"
"time"
"github.com/astaxie/beego/client/orm"
"github.com/astaxie/beego/core/logs"
"github.com/beego/beego/client/orm"
"github.com/beego/beego/core/logs"
)
// const the data format for the bee generate migration datatype

View File

@@ -194,7 +194,7 @@ checkType:
}
fieldType = f.FieldType()
if fieldType&IsRelField > 0 {
err = fmt.Errorf("unsupport type custom field, please refer to https://github.com/astaxie/beego/blob/master/orm/models_fields.go#L24-L42")
err = fmt.Errorf("unsupport type custom field, please refer to https://github.com/beego/beego/blob/master/orm/models_fields.go#L24-L42")
goto end
}
default:

View File

@@ -318,7 +318,7 @@ type Post struct {
Created time.Time `orm:"auto_now_add"`
Updated time.Time `orm:"auto_now"`
UpdatedPrecision time.Time `orm:"auto_now;type(datetime);precision(4)"`
Tags []*Tag `orm:"rel(m2m);rel_through(github.com/astaxie/beego/client/orm.PostTags)"`
Tags []*Tag `orm:"rel(m2m);rel_through(github.com/beego/beego/client/orm.PostTags)"`
}
func (u *Post) TableIndex() [][]string {
@@ -376,7 +376,7 @@ type Group struct {
type Permission struct {
ID int `orm:"column(id)"`
Name string
Groups []*Group `orm:"rel(m2m);rel_through(github.com/astaxie/beego/client/orm.GroupPermissions)"`
Groups []*Group `orm:"rel(m2m);rel_through(github.com/beego/beego/client/orm.GroupPermissions)"`
}
type GroupPermissions struct {
@@ -485,7 +485,7 @@ var (
usage:
go get -u github.com/astaxie/beego/client/orm
go get -u github.com/beego/beego/client/orm
go get -u github.com/go-sql-driver/mysql
go get -u github.com/mattn/go-sqlite3
go get -u github.com/lib/pq
@@ -495,25 +495,25 @@ var (
mysql -u root -e 'create database orm_test;'
export ORM_DRIVER=mysql
export ORM_SOURCE="root:@/orm_test?charset=utf8"
go test -v github.com/astaxie/beego/client/orm
go test -v github.com/beego/beego/client/orm
#### Sqlite3
export ORM_DRIVER=sqlite3
export ORM_SOURCE='file:memory_test?mode=memory'
go test -v github.com/astaxie/beego/client/orm
go test -v github.com/beego/beego/client/orm
#### PostgreSQL
psql -c 'create database orm_test;' -U postgres
export ORM_DRIVER=postgres
export ORM_SOURCE="user=postgres dbname=orm_test sslmode=disable"
go test -v github.com/astaxie/beego/client/orm
go test -v github.com/beego/beego/client/orm
#### TiDB
export ORM_DRIVER=tidb
export ORM_SOURCE='memory://test/test'
go test -v github.com/astaxie/beego/pgk/orm
go test -v github.com/beego/beego/pgk/orm
`
)

View File

@@ -21,7 +21,7 @@
//
// import (
// "fmt"
// "github.com/astaxie/beego/client/orm"
// "github.com/beego/beego/client/orm"
// _ "github.com/go-sql-driver/mysql" // import your used driver
// )
//
@@ -62,10 +62,10 @@ import (
"reflect"
"time"
"github.com/astaxie/beego/client/orm/hints"
"github.com/astaxie/beego/core/utils"
"github.com/beego/beego/client/orm/hints"
"github.com/beego/beego/core/utils"
"github.com/astaxie/beego/core/logs"
"github.com/beego/beego/core/logs"
)
// DebugQueries define the debug

View File

@@ -18,7 +18,7 @@ import (
"context"
"fmt"
"github.com/astaxie/beego/client/orm/hints"
"github.com/beego/beego/client/orm/hints"
)
type colValue struct {

View File

@@ -31,7 +31,7 @@ import (
"testing"
"time"
"github.com/astaxie/beego/client/orm/hints"
"github.com/beego/beego/client/orm/hints"
"github.com/stretchr/testify/assert"
)

View File

@@ -20,7 +20,7 @@ import (
"reflect"
"time"
"github.com/astaxie/beego/core/utils"
"github.com/beego/beego/core/utils"
)
// TableNaming is usually used by model

View File

@@ -67,4 +67,4 @@ func TestSnakeStringWithAcronym(t *testing.T) {
t.Error("Unit Test Fail:", v, res, answer[v])
}
}
}
}