improve gdb/gtime

This commit is contained in:
John
2019-12-17 21:06:34 +08:00
parent a5a88222a6
commit 5f2be10563
15 changed files with 217 additions and 64 deletions

View File

@ -53,6 +53,12 @@ func FindValue(fieldsAndWhere ...interface{}) (gdb.Value, error) {
return Model.Value(fieldsAndWhere...)
}
// FindCount retrieves and returns the record number by a primary key or where conditions by
// Model.Where. Also see FindOne.
func FindCount(where ...interface{}) (int, error) {
return Model.Count(gdb.GetPrimaryKeyCondition(Primary, where...)...)
}
// Insert is alias of Model.Insert.
func Insert(data ...interface{}) (result sql.Result, err error) {
return Model.Insert(data...)