From ca259233c1227432c7d2e8bf1740b4490af70a6c Mon Sep 17 00:00:00 2001 From: what Date: Thu, 20 Apr 2023 20:34:20 +0800 Subject: [PATCH] [feat] add NewOrm helper --- helper/orm.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helper/orm.go b/helper/orm.go index 3266e49..02bb663 100644 --- a/helper/orm.go +++ b/helper/orm.go @@ -3,6 +3,7 @@ package helper import ( "git.fsdpf.net/go/contracts" "git.fsdpf.net/go/contracts/base" + "git.fsdpf.net/go/db" ) // @title 创建关联模型 @@ -28,3 +29,5 @@ type NewOrmQueryField func(rField base.ResField, t contracts.QueryDataType, alia type NewOrderBy func(sql string, direction contracts.OrderByDirection) contracts.OrderBy type NewGroupBy func(sql string) contracts.GroupBy + +type NewOrm func(res contracts.Resource, tx *db.Transaction) contracts.Orm