MCPcopy Create free account
hub / github.com/apache/devlake / transformParams

Function transformParams

backend/impls/dalgorm/dalgorm.go:57–81  ·  view source on GitHub ↗
(params []interface{})

Source from the content-addressed store, hash-verified

55var _ dal.Dal = (*Dalgorm)(nil)
56
57func transformParams(params []interface{}) []interface{} {
58 tp := make([]interface{}, 0, len(params))
59
60 for _, v := range params {
61 switch p := v.(type) {
62 case dal.ClauseColumn:
63 tp = append(tp, clause.Column{
64 Table: p.Table,
65 Name: p.Name,
66 Alias: p.Alias,
67 Raw: p.Raw,
68 })
69 case dal.ClauseTable:
70 tp = append(tp, clause.Table{
71 Name: p.Name,
72 Alias: p.Alias,
73 Raw: p.Raw,
74 })
75 default:
76 tp = append(tp, p)
77 }
78 }
79
80 return tp
81}
82
83func buildTx(tx *gorm.DB, clauses []dal.Clause) *gorm.DB {
84 for _, c := range clauses {

Callers 4

buildTxFunction · 0.85
ExecMethod · 0.85
UpdateColumnMethod · 0.85
UpdateColumnsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected