瀏覽代碼

support get record

xormplus 7 年之前
父節點
當前提交
91de93f0c8
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      session_get.go

+ 1 - 1
session_get.go

@@ -96,7 +96,7 @@ func (session *Session) nocacheGet(beanKind reflect.Kind, table *core.Table, bea
 		return true, rows.Scan(&bean)
 		return true, rows.Scan(&bean)
 	case *sql.NullInt64, *sql.NullBool, *sql.NullFloat64, *sql.NullString:
 	case *sql.NullInt64, *sql.NullBool, *sql.NullFloat64, *sql.NullString:
 		return true, rows.Scan(bean)
 		return true, rows.Scan(bean)
-	case *map[string]Value:
+	case *map[string]Value, *Record:
 		vv := reflect.ValueOf(bean)
 		vv := reflect.ValueOf(bean)
 		if vv.Kind() != reflect.Ptr || vv.Elem().Kind() != reflect.Map {
 		if vv.Kind() != reflect.Ptr || vv.Elem().Kind() != reflect.Map {
 			return true, errors.New("dest should be a map's pointer")
 			return true, errors.New("dest should be a map's pointer")