Remove quotestr totally (#1366)

* remove QuoteStr() totally

* update xorm.core -> v0.7.0

* update dialect Quote
This commit is contained in:
BetaCat 2019-07-24 14:38:05 +08:00 committed by Lunny Xiao
parent 4b0ff8ad27
commit b757473de7
6 changed files with 896 additions and 920 deletions

View File

@ -286,10 +286,6 @@ func (db *mssql) Quote(name string) string {
return "\"" + name + "\"" return "\"" + name + "\""
} }
func (db *mssql) QuoteStr() string {
return "\""
}
func (db *mssql) SupportEngine() bool { func (db *mssql) SupportEngine() bool {
return false return false
} }

View File

@ -278,10 +278,6 @@ func (db *mysql) Quote(name string) string {
return "`" + name + "`" return "`" + name + "`"
} }
func (db *mysql) QuoteStr() string {
return "`"
}
func (db *mysql) SupportEngine() bool { func (db *mysql) SupportEngine() bool {
return true return true
} }
@ -559,8 +555,6 @@ func (db *mysql) CreateTableSql(table *core.Table, tableName, storeEngine, chars
sql += " DEFAULT CHARSET " + charset sql += " DEFAULT CHARSET " + charset
} }
if db.rowFormat != "" { if db.rowFormat != "" {
sql += " ROW_FORMAT=" + db.rowFormat sql += " ROW_FORMAT=" + db.rowFormat
} }

View File

@ -552,11 +552,7 @@ func (db *oracle) IsReserved(name string) bool {
} }
func (db *oracle) Quote(name string) string { func (db *oracle) Quote(name string) string {
return "\"" + name + "\"" return "[" + name + "]"
}
func (db *oracle) QuoteStr() string {
return "\""
} }
func (db *oracle) SupportEngine() bool { func (db *oracle) SupportEngine() bool {

View File

@ -863,10 +863,6 @@ func (db *postgres) Quote(name string) string {
return "\"" + name + "\"" return "\"" + name + "\""
} }
func (db *postgres) QuoteStr() string {
return "\""
}
func (db *postgres) AutoIncrStr() string { func (db *postgres) AutoIncrStr() string {
return "" return ""
} }
@ -1093,7 +1089,6 @@ func (db *postgres) GetTables() ([]*core.Table, error) {
return tables, nil return tables, nil
} }
func getIndexColName(indexdef string) []string { func getIndexColName(indexdef string) []string {
var colNames []string var colNames []string
@ -1105,7 +1100,6 @@ func getIndexColName(indexdef string) []string {
return colNames return colNames
} }
func (db *postgres) GetIndexes(tableName string) (map[string]*core.Index, error) { func (db *postgres) GetIndexes(tableName string) (map[string]*core.Index, error) {
args := []interface{}{tableName} args := []interface{}{tableName}
s := fmt.Sprintf("SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1") s := fmt.Sprintf("SELECT indexname, indexdef FROM pg_indexes WHERE tablename=$1")

View File

@ -202,10 +202,6 @@ func (db *sqlite3) Quote(name string) string {
return "`" + name + "`" return "`" + name + "`"
} }
func (db *sqlite3) QuoteStr() string {
return "`"
}
func (db *sqlite3) AutoIncrStr() string { func (db *sqlite3) AutoIncrStr() string {
return "AUTOINCREMENT" return "AUTOINCREMENT"
} }

2
go.mod
View File

@ -15,5 +15,5 @@ require (
github.com/stretchr/testify v1.3.0 github.com/stretchr/testify v1.3.0
github.com/ziutek/mymysql v1.5.4 github.com/ziutek/mymysql v1.5.4
xorm.io/builder v0.3.5 xorm.io/builder v0.3.5
xorm.io/core v0.6.3 xorm.io/core v0.7.0
) )