Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Commit b757473

Browse files
BetaCat0lunny
authored andcommitted
Remove quotestr totally (#1366)
* remove QuoteStr() totally * update xorm.core -> v0.7.0 * update dialect Quote
1 parent 4b0ff8a commit b757473

File tree

6 files changed

+896
-920
lines changed

6 files changed

+896
-920
lines changed

dialect_mssql.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,6 @@ func (db *mssql) Quote(name string) string {
286286
return "\"" + name + "\""
287287
}
288288

289-
func (db *mssql) QuoteStr() string {
290-
return "\""
291-
}
292-
293289
func (db *mssql) SupportEngine() bool {
294290
return false
295291
}

dialect_mysql.go

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func (db *mysql) SqlType(c *core.Column) string {
220220
case core.TimeStampz:
221221
res = core.Char
222222
c.Length = 64
223-
case core.Enum: //mysql enum
223+
case core.Enum: // mysql enum
224224
res = core.Enum
225225
res += "("
226226
opts := ""
@@ -229,7 +229,7 @@ func (db *mysql) SqlType(c *core.Column) string {
229229
}
230230
res += strings.TrimLeft(opts, ",")
231231
res += ")"
232-
case core.Set: //mysql set
232+
case core.Set: // mysql set
233233
res = core.Set
234234
res += "("
235235
opts := ""
@@ -278,10 +278,6 @@ func (db *mysql) Quote(name string) string {
278278
return "`" + name + "`"
279279
}
280280

281-
func (db *mysql) QuoteStr() string {
282-
return "`"
283-
}
284-
285281
func (db *mysql) SupportEngine() bool {
286282
return true
287283
}
@@ -360,7 +356,7 @@ func (db *mysql) GetColumns(tableName string) ([]string, map[string]*core.Column
360356
var len1, len2 int
361357
if len(cts) == 2 {
362358
idx := strings.Index(cts[1], ")")
363-
if colType == core.Enum && cts[1][0] == '\'' { //enum
359+
if colType == core.Enum && cts[1][0] == '\'' { // enum
364360
options := strings.Split(cts[1][0:idx], ",")
365361
col.EnumOptions = make(map[string]int)
366362
for k, v := range options {
@@ -408,7 +404,7 @@ func (db *mysql) GetColumns(tableName string) ([]string, map[string]*core.Column
408404
col.IsPrimaryKey = true
409405
}
410406
if colKey == "UNI" {
411-
//col.is
407+
// col.is
412408
}
413409

414410
if extra == "auto_increment" {
@@ -554,12 +550,10 @@ func (db *mysql) CreateTableSql(table *core.Table, tableName, storeEngine, chars
554550

555551
if len(charset) == 0 {
556552
charset = db.URI().Charset
557-
}
553+
}
558554
if len(charset) != 0 {
559555
sql += " DEFAULT CHARSET " + charset
560556
}
561-
562-
563557

564558
if db.rowFormat != "" {
565559
sql += " ROW_FORMAT=" + db.rowFormat
@@ -633,7 +627,7 @@ func (p *mysqlDriver) Parse(driverName, dataSourceName string) (*core.Uri, error
633627
`\/(?P<dbname>.*?)` + // /dbname
634628
`(?:\?(?P<params>[^\?]*))?$`) // [?param1=value1&paramN=valueN]
635629
matches := dsnPattern.FindStringSubmatch(dataSourceName)
636-
//tlsConfigRegister := make(map[string]*tls.Config)
630+
// tlsConfigRegister := make(map[string]*tls.Config)
637631
names := dsnPattern.SubexpNames()
638632

639633
uri := &core.Uri{DbType: core.MYSQL}

0 commit comments

Comments
 (0)