Browse Source

added bytes type

xormplus 9 years ago
parent
commit
e925ba9ce1
2 changed files with 3 additions and 0 deletions
  1. 2 0
      column.go
  2. 1 0
      type.go

+ 2 - 0
column.go

@@ -16,6 +16,7 @@ const (
 // database column
 // database column
 type Column struct {
 type Column struct {
 	Name            string
 	Name            string
+	TableName       string
 	FieldName       string
 	FieldName       string
 	SQLType         SQLType
 	SQLType         SQLType
 	Length          int
 	Length          int
@@ -42,6 +43,7 @@ type Column struct {
 func NewColumn(name, fieldName string, sqlType SQLType, len1, len2 int, nullable bool) *Column {
 func NewColumn(name, fieldName string, sqlType SQLType, len1, len2 int, nullable bool) *Column {
 	return &Column{
 	return &Column{
 		Name:            name,
 		Name:            name,
+		TableName:       "",
 		FieldName:       fieldName,
 		FieldName:       fieldName,
 		SQLType:         sqlType,
 		SQLType:         sqlType,
 		Length:          len1,
 		Length:          len1,

+ 1 - 0
type.go

@@ -207,6 +207,7 @@ var (
 	StringType = reflect.TypeOf(c_EMPTY_STRING)
 	StringType = reflect.TypeOf(c_EMPTY_STRING)
 	BoolType   = reflect.TypeOf(c_BOOL_DEFAULT)
 	BoolType   = reflect.TypeOf(c_BOOL_DEFAULT)
 	ByteType   = reflect.TypeOf(c_BYTE_DEFAULT)
 	ByteType   = reflect.TypeOf(c_BYTE_DEFAULT)
+	BytesType  = reflect.SliceOf(ByteType)
 
 
 	TimeType = reflect.TypeOf(c_TIME_DEFAULT)
 	TimeType = reflect.TypeOf(c_TIME_DEFAULT)
 )
 )