- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for BuildCondition (0.16 sec)
-
finisher_api.go
tx = db.Limit(1).Order(clause.OrderByColumn{ Column: clause.Column{Table: clause.CurrentTable, Name: clause.PrimaryKey}, }) if len(conds) > 0 { if exprs := tx.Statement.BuildCondition(conds[0], conds[1:]...); len(exprs) > 0 { tx.Statement.AddClause(clause.Where{Exprs: exprs}) } } tx.Statement.RaiseErrorOnNotFound = true tx.Statement.Dest = dest return tx.callbacks.Query().Execute(tx)
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Jan 12 08:42:21 GMT 2024 - 22.7K bytes - Viewed (0) -
statement_test.go
for w := 0; w < whereCount; w++ { s = s.clone() s.AddClause(clause.Where{ Exprs: s.BuildCondition(fmt.Sprintf("where%d", w)), }) } s1 := s.clone() s1.AddClause(clause.Where{ Exprs: s.BuildCondition("FINAL1"), }) s2 := s.clone() s2.AddClause(clause.Where{ Exprs: s.BuildCondition("FINAL2"), }) if reflect.DeepEqual(s1.Clauses["WHERE"], s2.Clauses["WHERE"]) {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Sat Dec 23 13:19:41 GMT 2023 - 1.9K bytes - Viewed (0) -
chainable_api.go
optimizer.ModifyStatement(tx.Statement) } else { whereConds = append(whereConds, cond) } } if len(whereConds) > 0 { tx.Statement.AddClause(clause.Where{Exprs: tx.Statement.BuildCondition(whereConds[0], whereConds[1:]...)}) } return } var tableRegexp = regexp.MustCompile(`(?i)(?:.+? AS (\w+)\s*(?:$|,)|^\w+\s+(\w+)$)`) // Table specify the table you would like to run db operations //
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Wed Apr 17 03:38:55 GMT 2024 - 14.3K bytes - Viewed (1) -
statement.go
func (stmt *Statement) AddClauseIfNotExists(v clause.Interface) { if c, ok := stmt.Clauses[v.Name()]; !ok || c.Expression == nil { stmt.AddClause(v) } } // BuildCondition build condition func (stmt *Statement) BuildCondition(query interface{}, args ...interface{}) []clause.Expression { if s, ok := query.(string); ok { // if it is a number, then treats it as primary key if _, err := strconv.Atoi(s); err != nil {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Jan 12 08:42:21 GMT 2024 - 19.8K bytes - Viewed (0)