aboutsummaryrefslogtreecommitdiffstats
path: root/models/models.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/models.go')
-rw-r--r--models/models.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/models/models.go b/models/models.go
index 04acc77aa9..e802a35a77 100644
--- a/models/models.go
+++ b/models/models.go
@@ -250,3 +250,8 @@ func MaxBatchInsertSize(bean interface{}) int {
t := x.TableInfo(bean)
return 999 / len(t.ColumnsSeq())
}
+
+// Count returns records number according struct's fields as database query conditions
+func Count(bean interface{}) (int64, error) {
+ return x.Count(bean)
+}