Browse Source

vendor: update github.com/go-xorm/core

Related #4642
pull/4940/merge
Unknwon 7 years ago
parent
commit
f274f76607
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 8
      vendor/github.com/go-xorm/core/cache.go
  2. 1
      vendor/github.com/go-xorm/core/circle.yml
  3. 19
      vendor/github.com/go-xorm/core/column.go
  4. 3
      vendor/github.com/go-xorm/core/dialect.go
  5. 12
      vendor/github.com/go-xorm/core/rows.go
  6. 3
      vendor/github.com/go-xorm/core/scan.go
  7. 41
      vendor/github.com/go-xorm/core/type.go
  8. 6
      vendor/vendor.json

8
vendor/github.com/go-xorm/core/cache.go generated vendored

@ -1,11 +1,12 @@
package core
import (
"bytes"
"encoding/gob"
"errors"
"fmt"
"strings"
"time"
"bytes"
"encoding/gob"
)
const (
@ -55,11 +56,10 @@ func encodeIds(ids []PK) (string, error) {
return buf.String(), err
}
func decodeIds(s string) ([]PK, error) {
pks := make([]PK, 0)
dec := gob.NewDecoder(bytes.NewBufferString(s))
dec := gob.NewDecoder(strings.NewReader(s))
err := dec.Decode(&pks)
return pks, err

1
vendor/github.com/go-xorm/core/circle.yml generated vendored

@ -12,3 +12,4 @@ test:
override:
# './...' is a relative pattern which means all subdirectories
- go test -v -race
- go test -v -race --dbtype=sqlite3

19
vendor/github.com/go-xorm/core/column.go generated vendored

@ -13,12 +13,13 @@ const (
ONLYFROMDB
)
// database column
// Column defines database column
type Column struct {
Name string
TableName string
FieldName string
SQLType SQLType
IsJSON bool
Length int
Length2 int
Nullable bool
@ -78,6 +79,10 @@ func (col *Column) String(d Dialect) string {
}
}
if col.Default != "" {
sql += "DEFAULT " + col.Default + " "
}
if d.ShowCreateNull() {
if col.Nullable {
sql += "NULL "
@ -86,10 +91,6 @@ func (col *Column) String(d Dialect) string {
}
}
if col.Default != "" {
sql += "DEFAULT " + col.Default + " "
}
return sql
}
@ -98,6 +99,10 @@ func (col *Column) StringNoPk(d Dialect) string {
sql += d.SqlType(col) + " "
if col.Default != "" {
sql += "DEFAULT " + col.Default + " "
}
if d.ShowCreateNull() {
if col.Nullable {
sql += "NULL "
@ -106,10 +111,6 @@ func (col *Column) StringNoPk(d Dialect) string {
}
}
if col.Default != "" {
sql += "DEFAULT " + col.Default + " "
}
return sql
}

3
vendor/github.com/go-xorm/core/dialect.go generated vendored

@ -244,6 +244,9 @@ func (b *Base) CreateTableSql(table *Table, tableName, storeEngine, charset stri
sql += col.StringNoPk(b.dialect)
}
sql = strings.TrimSpace(sql)
if b.DriverName() == MYSQL && len(col.Comment) > 0 {
sql += " COMMENT '" + col.Comment + "'"
}
sql += ", "
}

12
vendor/github.com/go-xorm/core/rows.go generated vendored

@ -247,6 +247,18 @@ type Row struct {
err error // deferred error for easy chaining
}
// ErrorRow return an error row
func ErrorRow(err error) *Row {
return &Row{
err: err,
}
}
// NewRow from rows
func NewRow(rows *Rows, err error) *Row {
return &Row{rows, err}
}
func (row *Row) Columns() ([]string, error) {
if row.err != nil {
return nil, row.err

3
vendor/github.com/go-xorm/core/scan.go generated vendored

@ -44,6 +44,9 @@ func convertTime(dest *NullTime, src interface{}) error {
}
*dest = NullTime(t)
return nil
case time.Time:
*dest = NullTime(s)
return nil
case nil:
default:
return fmt.Errorf("unsupported driver -> Scan pair: %T -> %T", src, dest)

41
vendor/github.com/go-xorm/core/type.go generated vendored

@ -69,15 +69,17 @@ var (
Enum = "ENUM"
Set = "SET"
Char = "CHAR"
Varchar = "VARCHAR"
NVarchar = "NVARCHAR"
TinyText = "TINYTEXT"
Text = "TEXT"
Clob = "CLOB"
MediumText = "MEDIUMTEXT"
LongText = "LONGTEXT"
Uuid = "UUID"
Char = "CHAR"
Varchar = "VARCHAR"
NVarchar = "NVARCHAR"
TinyText = "TINYTEXT"
Text = "TEXT"
Clob = "CLOB"
MediumText = "MEDIUMTEXT"
LongText = "LONGTEXT"
Uuid = "UUID"
UniqueIdentifier = "UNIQUEIDENTIFIER"
SysName = "SYSNAME"
Date = "DATE"
DateTime = "DATETIME"
@ -100,7 +102,8 @@ var (
LongBlob = "LONGBLOB"
Bytea = "BYTEA"
Bool = "BOOL"
Bool = "BOOL"
Boolean = "BOOLEAN"
Serial = "SERIAL"
BigSerial = "BIGSERIAL"
@ -131,6 +134,7 @@ var (
LongText: TEXT_TYPE,
Uuid: TEXT_TYPE,
Clob: TEXT_TYPE,
SysName: TEXT_TYPE,
Date: TIME_TYPE,
DateTime: TIME_TYPE,
@ -147,11 +151,12 @@ var (
Binary: BLOB_TYPE,
VarBinary: BLOB_TYPE,
TinyBlob: BLOB_TYPE,
Blob: BLOB_TYPE,
MediumBlob: BLOB_TYPE,
LongBlob: BLOB_TYPE,
Bytea: BLOB_TYPE,
TinyBlob: BLOB_TYPE,
Blob: BLOB_TYPE,
MediumBlob: BLOB_TYPE,
LongBlob: BLOB_TYPE,
Bytea: BLOB_TYPE,
UniqueIdentifier: BLOB_TYPE,
Bool: NUMERIC_TYPE,
@ -163,7 +168,7 @@ var (
uintTypes = sort.StringSlice{"*uint", "*uint16", "*uint32", "*uint8"}
)
// !nashtsai! treat following var as interal const values, these are used for reflect.TypeOf comparision
// !nashtsai! treat following var as interal const values, these are used for reflect.TypeOf comparison
var (
c_EMPTY_STRING string
c_BOOL_DEFAULT bool
@ -288,9 +293,9 @@ func SQLType2Type(st SQLType) reflect.Type {
return reflect.TypeOf(float32(1))
case Double:
return reflect.TypeOf(float64(1))
case Char, Varchar, NVarchar, TinyText, Text, MediumText, LongText, Enum, Set, Uuid, Clob:
case Char, Varchar, NVarchar, TinyText, Text, MediumText, LongText, Enum, Set, Uuid, Clob, SysName:
return reflect.TypeOf("")
case TinyBlob, Blob, LongBlob, Bytea, Binary, MediumBlob, VarBinary:
case TinyBlob, Blob, LongBlob, Bytea, Binary, MediumBlob, VarBinary, UniqueIdentifier:
return reflect.TypeOf([]byte{})
case Bool:
return reflect.TypeOf(true)

6
vendor/vendor.json vendored

@ -159,10 +159,10 @@
"revisionTime": "2017-05-19T03:21:30Z"
},
{
"checksumSHA1": "GnWfEqqhYT5MsxzlB6bRESmkDvM=",
"checksumSHA1": "2r7L5MfFaUro2xn9sjBQuz4jzmw=",
"path": "github.com/go-xorm/core",
"revision": "6c9f9bf3130d143937e4adcef1cf1bb9f6899260",
"revisionTime": "2017-05-03T12:16:46Z"
"revision": "11bcc82696a93ff9339bd30ff0035f2d6b61d17b",
"revisionTime": "2018-02-27T08:09:17Z"
},
{
"checksumSHA1": "UN8r+3fuSzXJ1tXCe+M8g5eRpOI=",

Loading…
Cancel
Save