1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-12 00:40:39 +00:00
This commit is contained in:
astaxie
2014-04-11 16:08:43 +08:00
parent 05e5baaa9f
commit 4245521660
24 changed files with 10 additions and 47 deletions

View File

@ -446,7 +446,6 @@ func (d *dbBase) Update(q dbQuerier, mi *modelInfo, ind reflect.Value, tz *time.
} else {
return 0, err
}
return 0, nil
}
// execute delete sql dbQuerier with given struct reflect.Value.
@ -489,7 +488,6 @@ func (d *dbBase) Delete(q dbQuerier, mi *modelInfo, ind reflect.Value, tz *time.
} else {
return 0, err
}
return 0, nil
}
// update table-related record by querySet.
@ -566,7 +564,6 @@ func (d *dbBase) UpdateBatch(q dbQuerier, qs *querySet, mi *modelInfo, cond *Con
} else {
return 0, err
}
return 0, nil
}
// delete related records.
@ -671,8 +668,6 @@ func (d *dbBase) DeleteBatch(q dbQuerier, qs *querySet, mi *modelInfo, cond *Con
} else {
return 0, err
}
return 0, nil
}
// read related records.

View File

@ -13,7 +13,6 @@ func getDbAlias(name string) *alias {
} else {
panic(fmt.Errorf("unknown DataBase alias name %s", name))
}
return nil
}
// get pk column info.

View File

@ -83,7 +83,6 @@ func (e *JsonField) SetRaw(value interface{}) error {
default:
return fmt.Errorf("<JsonField.SetRaw> unknown value `%v`", value)
}
return nil
}
func (e *JsonField) RawValue() interface{} {
@ -122,7 +121,7 @@ type DataNull struct {
Char string `orm:"null;size(50)"`
Text string `orm:"null;type(text)"`
Date time.Time `orm:"null;type(date)"`
DateTime time.Time `orm:"null;column(datetime)""`
DateTime time.Time `orm:"null;column(datetime)"`
Byte byte `orm:"null"`
Rune rune `orm:"null"`
Int int `orm:"null"`

View File

@ -293,7 +293,7 @@ func (o *orm) queryRelated(md interface{}, name string) (*modelInfo, *fieldInfo,
}
if qs == nil {
panic(fmt.Errorf("<Ormer> name `%s` for model `%s` is not an available rel/reverse field"))
panic(fmt.Errorf("<Ormer> name `%s` for model `%s` is not an available rel/reverse field", md, name))
}
return mi, fi, ind, qs
@ -441,8 +441,6 @@ func (o *orm) Driver() Driver {
func (o *orm) GetDB() dbQuerier {
panic(ErrNotImplement)
// not enough
return o.db
}
// create new orm

View File

@ -209,7 +209,6 @@ func (o *querySet) ValuesFlat(result *ParamsList, expr string) (int64, error) {
// }
func (o *querySet) RowsToMap(result *Params, keyCol, valueCol string) (int64, error) {
panic(ErrNotImplement)
return o.orm.alias.DbBaser.RowsTo(o.orm.db, o, o.mi, o.cond, result, keyCol, valueCol, o.orm.alias.TZ)
}
// query all rows into struct with specify key and value column name.
@ -224,7 +223,6 @@ func (o *querySet) RowsToMap(result *Params, keyCol, valueCol string) (int64, er
// }
func (o *querySet) RowsToStruct(ptrStruct interface{}, keyCol, valueCol string) (int64, error) {
panic(ErrNotImplement)
return o.orm.alias.DbBaser.RowsTo(o.orm.db, o, o.mi, o.cond, ptrStruct, keyCol, valueCol, o.orm.alias.TZ)
}
// create new QuerySeter.

View File

@ -282,10 +282,10 @@ func TestNullDataTypes(t *testing.T) {
d = DataNull{
DateTime: time.Now(),
NullString: sql.NullString{"test", true},
NullBool: sql.NullBool{true, true},
NullInt64: sql.NullInt64{42, true},
NullFloat64: sql.NullFloat64{42.42, true},
NullString: sql.NullString{String: "test", Valid: true},
NullBool: sql.NullBool{Bool: true, Valid: true},
NullInt64: sql.NullInt64{Int64: 42, Valid: true},
NullFloat64: sql.NullFloat64{Float64: 42.42, Valid: true},
}
id, err = dORM.Insert(&d)

View File

@ -266,5 +266,4 @@ func indirectType(v reflect.Type) reflect.Type {
default:
return v
}
return v
}