bug fix for get sqlite meta informations

This commit is contained in:
Lunny Xiao 2017-01-22 17:17:55 +08:00
parent c360c20aa5
commit 57bcb65078
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
2 changed files with 2 additions and 2 deletions

View File

@ -359,7 +359,7 @@ func (engine *Engine) DBMetas() ([]*core.Table, error) {
if col := table.GetColumn(name); col != nil { if col := table.GetColumn(name); col != nil {
col.Indexes[index.Name] = index.Type col.Indexes[index.Name] = index.Type
} else { } else {
return nil, fmt.Errorf("Unknown col %s in indexe %v of table %v, columns %v", name, index.Name, table.Name, table.ColumnsSeq()) return nil, fmt.Errorf("Unknown col %s in index %v of table %v, columns %v", name, index.Name, table.Name, table.ColumnsSeq())
} }
} }
} }

View File

@ -317,7 +317,7 @@ func (db *sqlite3) GetColumns(tableName string) ([]string, map[string]*core.Colu
col.DefaultIsEmpty = true col.DefaultIsEmpty = true
for idx, field := range fields { for idx, field := range fields {
if idx == 0 { if idx == 0 {
col.Name = strings.Trim(field, "`[] ") col.Name = strings.Trim(strings.Trim(field, "`[] "), `"`)
continue continue
} else if idx == 1 { } else if idx == 1 {
col.SQLType = core.SQLType{Name: field, DefaultLength: 0, DefaultLength2: 0} col.SQLType = core.SQLType{Name: field, DefaultLength: 0, DefaultLength2: 0}