Skip to content
This repository has been 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

Permalink
Remove quotestr totally (#1366)
Browse files Browse the repository at this point in the history
* remove QuoteStr() totally

* update xorm.core -> v0.7.0

* update dialect Quote
  • Loading branch information
BetaCat0 authored and lunny committed Jul 24, 2019
1 parent 4b0ff8a commit b757473
Show file tree
Hide file tree
Showing 6 changed files with 896 additions and 920 deletions.
4 changes: 0 additions & 4 deletions dialect_mssql.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,6 @@ func (db *mssql) Quote(name string) string {
return "\"" + name + "\""
}

func (db *mssql) QuoteStr() string {
return "\""
}

func (db *mssql) SupportEngine() bool {
return false
}
Expand Down
18 changes: 6 additions & 12 deletions dialect_mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (db *mysql) SqlType(c *core.Column) string {
case core.TimeStampz:
res = core.Char
c.Length = 64
case core.Enum: //mysql enum
case core.Enum: // mysql enum
res = core.Enum
res += "("
opts := ""
Expand All @@ -229,7 +229,7 @@ func (db *mysql) SqlType(c *core.Column) string {
}
res += strings.TrimLeft(opts, ",")
res += ")"
case core.Set: //mysql set
case core.Set: // mysql set
res = core.Set
res += "("
opts := ""
Expand Down Expand Up @@ -278,10 +278,6 @@ func (db *mysql) Quote(name string) string {
return "`" + name + "`"
}

func (db *mysql) QuoteStr() string {
return "`"
}

func (db *mysql) SupportEngine() bool {
return true
}
Expand Down Expand Up @@ -360,7 +356,7 @@ func (db *mysql) GetColumns(tableName string) ([]string, map[string]*core.Column
var len1, len2 int
if len(cts) == 2 {
idx := strings.Index(cts[1], ")")
if colType == core.Enum && cts[1][0] == '\'' { //enum
if colType == core.Enum && cts[1][0] == '\'' { // enum
options := strings.Split(cts[1][0:idx], ",")
col.EnumOptions = make(map[string]int)
for k, v := range options {
Expand Down Expand Up @@ -408,7 +404,7 @@ func (db *mysql) GetColumns(tableName string) ([]string, map[string]*core.Column
col.IsPrimaryKey = true
}
if colKey == "UNI" {
//col.is
// col.is
}

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

if len(charset) == 0 {
charset = db.URI().Charset
}
}
if len(charset) != 0 {
sql += " DEFAULT CHARSET " + charset
}



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

uri := &core.Uri{DbType: core.MYSQL}
Expand Down
Loading

0 comments on commit b757473

Please sign in to comment.