Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for BuildCondition (0.19 sec)

  1. 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 Apr 21 09:35:09 GMT 2024
    - Last Modified: Sat Dec 23 13:19:41 GMT 2023
    - 1.9K bytes
    - Viewed (0)
  2. 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 Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
  3. 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 Apr 21 09:35:09 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  4. association.go

    		Error:        association.Error,
    		Unscope:      true,
    	}
    }
    
    func (association *Association) Find(out interface{}, conds ...interface{}) error {
    	if association.Error == nil {
    		association.Error = association.buildCondition().Find(out, conds...).Error
    	}
    	return association.Error
    }
    
    func (association *Association) Append(values ...interface{}) error {
    	if association.Error == nil {
    		switch association.Relationship.Type {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Thu May 04 11:30:45 GMT 2023
    - 21.2K bytes
    - Viewed (0)
  5. 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 Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
Back to top