MCPcopy
hub / github.com/go-gorm/gorm / AddClause

Method AddClause

statement.go:272–282  ·  view source on GitHub ↗

AddClause add clause

(v clause.Interface)

Source from the content-addressed store, hash-verified

270
271// AddClause add clause
272func (stmt *Statement) AddClause(v clause.Interface) {
273 if optimizer, ok := v.(StatementModifier); ok {
274 optimizer.ModifyStatement(stmt)
275 } else {
276 name := v.Name()
277 c := stmt.Clauses[name]
278 c.Name = name
279 v.MergeClause(&c)
280 stmt.Clauses[name] = c
281 }
282}
283
284// AddClauseIfNotExists add clause if not exists
285func (stmt *Statement) AddClauseIfNotExists(v clause.Interface) {

Callers 15

AddClauseIfNotExistsMethod · 0.95
buildConditionMethod · 0.95
BuildQuerySQLFunction · 0.95
BenchmarkSelectFunction · 0.95
BenchmarkComplexSelectFunction · 0.95
ClausesMethod · 0.80
SelectMethod · 0.80
WhereMethod · 0.80
NotMethod · 0.80
OrMethod · 0.80
GroupMethod · 0.80
HavingMethod · 0.80

Calls 3

ModifyStatementMethod · 0.65
NameMethod · 0.65
MergeClauseMethod · 0.65

Tested by 4

BenchmarkSelectFunction · 0.76
BenchmarkComplexSelectFunction · 0.76
TestWhereCloneCorruptionFunction · 0.64
checkBuildClausesFunction · 0.64