fix migrate failed and org dashboard failed on MSSQL database (#1448)

This commit is contained in:
Lunny Xiao 2017-04-06 18:47:25 -07:00 committed by GitHub
parent cf6699fb4f
commit 5acfc7c4bc
36 changed files with 1999 additions and 1634 deletions

View file

@ -70,7 +70,7 @@ func (session *Session) innerQuery2(sqlStr string, params ...interface{}) ([]map
return rows2maps(rows)
}
// Query a raw sql and return records as []map[string][]byte
// Query runs a raw sql and return records as []map[string][]byte
func (session *Session) Query(sqlStr string, paramStr ...interface{}) (resultsSlice []map[string][]byte, err error) {
defer session.resetStatement()
if session.IsAutoClose {
@ -80,6 +80,15 @@ func (session *Session) Query(sqlStr string, paramStr ...interface{}) (resultsSl
return session.query(sqlStr, paramStr...)
}
// QueryString runs a raw sql and return records as []map[string]string
func (session *Session) QueryString(sqlStr string, args ...interface{}) ([]map[string]string, error) {
defer session.resetStatement()
if session.IsAutoClose {
defer session.Close()
}
return session.query2(sqlStr, args...)
}
// =============================
// for string
// =============================