using new organization
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# beego orm
|
||||
|
||||
[](https://drone.io/github.com/astaxie/beego/latest)
|
||||
[](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
|
||||
)
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego/client/orm/hints"
|
||||
"github.com/beego/beego/client/orm/hints"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/astaxie/beego/client/orm/hints"
|
||||
"github.com/beego/beego/client/orm/hints"
|
||||
)
|
||||
|
||||
// oracle operators.
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego/client/orm/hints"
|
||||
"github.com/beego/beego/client/orm/hints"
|
||||
)
|
||||
|
||||
// sqlite operators.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
"github.com/astaxie/beego/core/utils"
|
||||
"github.com/beego/beego/core/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/astaxie/beego/core/utils"
|
||||
"github.com/beego/beego/core/utils"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
package hints
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego/core/utils"
|
||||
"github.com/beego/beego/core/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
`
|
||||
)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -18,7 +18,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/astaxie/beego/client/orm/hints"
|
||||
"github.com/beego/beego/client/orm/hints"
|
||||
)
|
||||
|
||||
type colValue struct {
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -67,4 +67,4 @@ func TestSnakeStringWithAcronym(t *testing.T) {
|
||||
t.Error("Unit Test Fail:", v, res, answer[v])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user