Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for AddClauseIfNotExists (0.28 sec)

  1. callbacks/query.go

    						Expression: clause.NamedExpr{SQL: join.Name, Vars: join.Conds},
    					})
    				}
    			}
    
    			db.Statement.AddClause(fromClause)
    		} else {
    			db.Statement.AddClauseIfNotExists(clause.From{})
    		}
    
    		db.Statement.AddClauseIfNotExists(clauseSelect)
    
    		db.Statement.Build(db.Statement.BuildClauses...)
    	}
    }
    
    func Preload(db *gorm.DB) {
    	if db.Error == nil && len(db.Statement.Preloads) > 0 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Jan 29 03:34:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  2. statement.go

    	} else {
    		name := v.Name()
    		c := stmt.Clauses[name]
    		c.Name = name
    		v.MergeClause(&c)
    		stmt.Clauses[name] = c
    	}
    }
    
    // AddClauseIfNotExists add clause if not exists
    func (stmt *Statement) AddClauseIfNotExists(v clause.Interface) {
    	if c, ok := stmt.Clauses[v.Name()]; !ok || c.Expression == nil {
    		stmt.AddClause(v)
    	}
    }
    
    // BuildCondition build condition
    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)
  3. callbacks/create.go

    					}
    					db.Statement.AddClause(clause.Returning{Columns: fromColumns})
    				}
    			}
    		}
    
    		if db.Statement.SQL.Len() == 0 {
    			db.Statement.SQL.Grow(180)
    			db.Statement.AddClauseIfNotExists(clause.Insert{})
    			db.Statement.AddClause(ConvertToCreateValues(db.Statement))
    
    			db.Statement.Build(db.Statement.BuildClauses...)
    		}
    
    		isDryRun := !db.DryRun && db.Error == nil
    		if !isDryRun {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 08 03:29:55 GMT 2024
    - 12.5K bytes
    - Viewed (0)
  4. finisher_api.go

    				column = f.DBName
    			}
    		}
    	}
    
    	if len(tx.Statement.Selects) != 1 {
    		fields := strings.FieldsFunc(column, utils.IsValidDBNameChar)
    		tx.Statement.AddClauseIfNotExists(clause.Select{
    			Distinct: tx.Statement.Distinct,
    			Columns:  []clause.Column{{Name: column, Raw: len(fields) != 1}},
    		})
    	}
    	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)
Back to top