This commit is contained in:
Daniel Sullivan 2019-09-18 19:21:15 +09:00
parent c5537355c7
commit 88867e2416
22 changed files with 62 additions and 33 deletions

View File

@ -1,4 +1,4 @@
Your issue may already be reported! Please search on the [issue track](https://github.com/jinzhu/gorm/issues) before creating one. Your issue may already be reported! Please search on the [issue track](https://github.com/charm-jp/gorm/issues) before creating one.
### What version of Go are you using (`go version`)? ### What version of Go are you using (`go version`)?
@ -8,17 +8,17 @@ Your issue may already be reported! Please search on the [issue track](https://g
### Please provide a complete runnable program to reproduce your issue. **IMPORTANT** ### Please provide a complete runnable program to reproduce your issue. **IMPORTANT**
Need to runnable with [GORM's docker compose config](https://github.com/jinzhu/gorm/blob/master/docker-compose.yml) or please provides your config. Need to runnable with [GORM's docker compose config](https://github.com/charm-jp/gorm/blob/master/docker-compose.yml) or please provides your config.
```go ```go
package main package main
import ( import (
"github.com/jinzhu/gorm" "github.com/charm-jp/gorm"
_ "github.com/jinzhu/gorm/dialects/mssql" _ "github.com/charm-jp/gorm/dialects/mssql"
_ "github.com/jinzhu/gorm/dialects/mysql" _ "github.com/charm-jp/gorm/dialects/mysql"
_ "github.com/jinzhu/gorm/dialects/postgres" _ "github.com/charm-jp/gorm/dialects/postgres"
_ "github.com/jinzhu/gorm/dialects/sqlite" _ "github.com/charm-jp/gorm/dialects/sqlite"
) )
var db *gorm.DB var db *gorm.DB

9
.idea/gorm.iml generated Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/misc.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>

8
.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/gorm.iml" filepath="$PROJECT_DIR$/.idea/gorm.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -2,14 +2,14 @@
The fantastic ORM library for Golang, aims to be developer friendly. 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/github.com/charm-jp/gorm "go report card")](https://goreportcard.com/report/github.com/charm-jp/gorm)
[![wercker status](https://app.wercker.com/status/8596cace912c9947dd9c8542ecc8cb8b/s/master "wercker status")](https://app.wercker.com/project/byKey/8596cace912c9947dd9c8542ecc8cb8b) [![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) [![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) [![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 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) [![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) [![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/github.com/charm-jp/gorm?status.svg)](https://godoc.org/github.com/charm-jp/gorm)
## Overview ## Overview
@ -38,4 +38,4 @@ The fantastic ORM library for Golang, aims to be developer friendly.
© Jinzhu, 2013~time.Now © Jinzhu, 2013~time.Now
Released under the [MIT License](https://github.com/jinzhu/gorm/blob/master/License) Released under the [MIT License](https://github.com/charm-jp/gorm/blob/master/License)

View File

@ -7,7 +7,7 @@ import (
"sort" "sort"
"testing" "testing"
"github.com/jinzhu/gorm" "github.com/charm-jp/gorm"
) )
func TestBelongsTo(t *testing.T) { func TestBelongsTo(t *testing.T) {

View File

@ -5,7 +5,7 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/jinzhu/gorm" "github.com/charm-jp/gorm"
) )
func (s *Product) BeforeCreate() (err error) { func (s *Product) BeforeCreate() (err error) {

View File

@ -4,7 +4,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/jinzhu/gorm" "github.com/charm-jp/gorm"
) )
type CustomizeColumn struct { type CustomizeColumn struct {

View File

@ -10,9 +10,9 @@ import (
"strings" "strings"
"time" "time"
"github.com/charm-jp/gorm"
// Importing mssql driver package only in dialect file, otherwide not needed // Importing mssql driver package only in dialect file, otherwide not needed
_ "github.com/denisenkom/go-mssqldb" _ "github.com/denisenkom/go-mssqldb"
"github.com/jinzhu/gorm"
) )
func setIdentityInsert(scope *gorm.Scope) { func setIdentityInsert(scope *gorm.Scope) {

View File

@ -4,7 +4,7 @@ import (
"errors" "errors"
"testing" "testing"
"github.com/jinzhu/gorm" "github.com/charm-jp/gorm"
) )
func TestErrorsCanBeUsedOutsideGorm(t *testing.T) { func TestErrorsCanBeUsedOutsideGorm(t *testing.T) {

View File

@ -6,7 +6,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/jinzhu/gorm" "github.com/charm-jp/gorm"
) )
type CalculateField struct { type CalculateField struct {

View File

@ -6,7 +6,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/jinzhu/gorm" "github.com/charm-jp/gorm"
) )
type Person struct { type Person struct {

View File

@ -51,10 +51,10 @@ const (
// db, err := gorm.Open("mysql", "user:password@/dbname?charset=utf8&parseTime=True&loc=Local") // db, err := gorm.Open("mysql", "user:password@/dbname?charset=utf8&parseTime=True&loc=Local")
// } // }
// GORM has wrapped some drivers, for easier to remember driver's import path, so you could import the mysql driver with // GORM has wrapped some drivers, for easier to remember driver's import path, so you could import the mysql driver with
// import _ "github.com/jinzhu/gorm/dialects/mysql" // import _ "github.com/charm-jp/gorm/dialects/mysql"
// // import _ "github.com/jinzhu/gorm/dialects/postgres" // // import _ "github.com/charm-jp/gorm/dialects/postgres"
// // import _ "github.com/jinzhu/gorm/dialects/sqlite" // // import _ "github.com/charm-jp/gorm/dialects/sqlite"
// // import _ "github.com/jinzhu/gorm/dialects/mssql" // // import _ "github.com/charm-jp/gorm/dialects/mssql"
func Open(dialect string, args ...interface{}) (db *DB, err error) { func Open(dialect string, args ...interface{}) (db *DB, err error) {
if len(args) == 0 { if len(args) == 0 {
err = errors.New("invalid database source") err = errors.New("invalid database source")

View File

@ -18,12 +18,12 @@ import (
"testing" "testing"
"time" "time"
"github.com/charm-jp/gorm"
_ "github.com/charm-jp/gorm/dialects/mssql"
_ "github.com/charm-jp/gorm/dialects/mysql"
"github.com/charm-jp/gorm/dialects/postgres"
_ "github.com/charm-jp/gorm/dialects/sqlite"
"github.com/erikstmartin/go-testdb" "github.com/erikstmartin/go-testdb"
"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/now" "github.com/jinzhu/now"
) )

View File

@ -11,7 +11,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/jinzhu/gorm" "github.com/charm-jp/gorm"
) )
type User struct { type User struct {

View File

@ -3,7 +3,7 @@ package gorm_test
import ( import (
"testing" "testing"
"github.com/jinzhu/gorm" "github.com/charm-jp/gorm"
) )
func TestTheNamingStrategy(t *testing.T) { func TestTheNamingStrategy(t *testing.T) {

View File

@ -7,7 +7,7 @@ import (
"reflect" "reflect"
"testing" "testing"
"github.com/jinzhu/gorm" "github.com/charm-jp/gorm"
) )
func getPreloadUser(name string) *User { func getPreloadUser(name string) *User {

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"reflect" "reflect"
"github.com/jinzhu/gorm" "github.com/charm-jp/gorm"
"testing" "testing"
"time" "time"

View File

@ -6,7 +6,7 @@ import (
"errors" "errors"
"testing" "testing"
"github.com/jinzhu/gorm" "github.com/charm-jp/gorm"
) )
func TestScannableSlices(t *testing.T) { func TestScannableSlices(t *testing.T) {

View File

@ -6,7 +6,7 @@ import (
"strings" "strings"
"testing" "testing"
"github.com/jinzhu/gorm" "github.com/charm-jp/gorm"
) )
func NameIn1And2(d *gorm.DB) *gorm.DB { func NameIn1And2(d *gorm.DB) *gorm.DB {

View File

@ -4,7 +4,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/jinzhu/gorm" "github.com/charm-jp/gorm"
) )
func TestUpdate(t *testing.T) { func TestUpdate(t *testing.T) {