Merge 51213b0f69d6495e00c40bfac78270e3594ed5c2 into 447885d98f9d07a138733a0e65428dd2de1ed60d

This commit is contained in:
seriallink 2015-09-07 20:58:31 +00:00
commit 27d3c2d6a5

View File

@ -5,6 +5,7 @@ import (
"database/sql/driver"
"fmt"
"reflect"
"strings"
"time"
"github.com/lib/pq/hstore"
@ -60,7 +61,12 @@ func (postgres) SqlTag(value reflect.Value, size int, autoIncrease bool) string
}
func (s postgres) ReturningStr(tableName, key string) string {
return fmt.Sprintf("RETURNING %v.%v", s.Quote(tableName), key)
fullName := strings.Split(tableName,".")
if len(fullName) == 1 {
return fmt.Sprintf("RETURNING %v.%v", s.Quote(tableName), key)
} else {
return fmt.Sprintf("RETURNING %v.%v.%v", s.Quote(fullName[0]), s.Quote(fullName[1]), key)
}
}
func (s postgres) HasTable(scope *Scope, tableName string) bool {