Merge branch 'master' into impr/row2bean
This commit is contained in:
commit
af7efeff9a
|
@ -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())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1599,6 +1599,8 @@ func (engine *Engine) formatTime(tz *time.Location, sqlTypeName string, t time.T
|
||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
if tz != nil {
|
if tz != nil {
|
||||||
|
t = t.In(tz)
|
||||||
|
} else {
|
||||||
t = engine.TZTime(t)
|
t = engine.TZTime(t)
|
||||||
}
|
}
|
||||||
switch sqlTypeName {
|
switch sqlTypeName {
|
||||||
|
|
|
@ -226,7 +226,7 @@ func (session *Session) Delete(bean interface{}) (int64, error) {
|
||||||
session.afterDeleteBeans[bean] = &afterClosures
|
session.afterDeleteBeans[bean] = &afterClosures
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if _, ok := interface{}(bean).(AfterInsertProcessor); ok {
|
if _, ok := interface{}(bean).(AfterDeleteProcessor); ok {
|
||||||
session.afterDeleteBeans[bean] = nil
|
session.afterDeleteBeans[bean] = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -333,7 +333,7 @@ func (session *Session) Update(bean interface{}, condiBean ...interface{}) (int6
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if _, ok := interface{}(bean).(AfterInsertProcessor); ok {
|
if _, ok := interface{}(bean).(AfterUpdateProcessor); ok {
|
||||||
session.afterUpdateBeans[bean] = nil
|
session.afterUpdateBeans[bean] = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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}
|
||||||
|
|
Loading…
Reference in New Issue