struct support to builder.EqStruct #78

Open
opened 2020-09-14 06:44:01 +00:00 by RelicOfTesla · 0 comments

like xormDb.Get(&result, condStruct)



cond := builder.Eq(condStruct{
   Status : xxx,
}).And(builder.Gt{
   Id : xxx,
}).And(...)

// or 

cond := builder.StructEq(condStruct{
   Status : xxx,
}).And(builder.StructGt{
   Id : xxx,
}).And(...)

// or 
var g_condStruct = cond.NewCondCacheParse() // global cache
g_condStruct.WithTag("json") //xorm

cond := g_condStruct.Eq(condStruct{
   Status : xxx,
}).And(g_condStruct.Gt(condStruct{
   Id : xxx,
}).And(...)



Now, I can discard the any const field name define..

like xormDb.Get(&result, condStruct) ```go cond := builder.Eq(condStruct{ Status : xxx, }).And(builder.Gt{ Id : xxx, }).And(...) // or cond := builder.StructEq(condStruct{ Status : xxx, }).And(builder.StructGt{ Id : xxx, }).And(...) // or var g_condStruct = cond.NewCondCacheParse() // global cache g_condStruct.WithTag("json") //xorm cond := g_condStruct.Eq(condStruct{ Status : xxx, }).And(g_condStruct.Gt(condStruct{ Id : xxx, }).And(...) ``` Now, I can discard the any const field name define..
lunny added the
feature
label 2020-12-22 13:01:09 +00:00
lunny added this to the (deleted) milestone 2021-04-02 16:11:01 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/builder#78
No description provided.