Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for ToQueryValues (0.08 sec)

  1. callbacks/delete.go

    							Value:  ref.PrimaryValue,
    						})
    					}
    				}
    
    				_, foreignValues := schema.GetIdentityFieldValuesMap(db.Statement.Context, db.Statement.ReflectValue, foreignFields)
    				column, values := schema.ToQueryValues(table, relForeignKeys, foreignValues)
    				queryConds = append(queryConds, clause.IN{Column: column, Values: values})
    
    				if db.AddError(tx.Clauses(clause.Where{Exprs: queryConds}).Delete(modelValue).Error) != nil {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Fri Feb 25 02:48:23 UTC 2022
    - 5.6K bytes
    - Viewed (0)
  2. association.go

    			if column, values := schema.ToQueryValues(rel.JoinTable.Table, joinPrimaryKeys, pvs); len(values) > 0 {
    				tx.Where(clause.IN{Column: column, Values: values})
    			} else {
    				return ErrPrimaryKeyRequired
    			}
    
    			_, rvs := schema.GetIdentityFieldValuesMapFromValues(association.DB.Statement.Context, values, relPrimaryFields)
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 21.5K bytes
    - Viewed (0)
  3. callbacks/preload.go

    		if len(joinForeignValues) == 0 {
    			return nil
    		}
    
    		joinResults := rel.JoinTable.MakeSlice().Elem()
    		column, values := schema.ToQueryValues(clause.CurrentTable, joinForeignKeys, joinForeignValues)
    		if err := tx.Where(clause.IN{Column: column, Values: values}).Find(joinResults.Addr().Interface()).Error; err != nil {
    			return err
    		}
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 10:52:33 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  4. soft_delete.go

    		stmt.SetColumn(sd.Field.DBName, curTime, true)
    
    		if stmt.Schema != nil {
    			_, queryValues := schema.GetIdentityFieldValuesMap(stmt.Context, stmt.ReflectValue, stmt.Schema.PrimaryFields)
    			column, values := schema.ToQueryValues(stmt.Table, stmt.Schema.PrimaryFieldDBNames, queryValues)
    
    			if len(values) > 0 {
    				stmt.AddClause(clause.Where{Exprs: []clause.Expression{clause.IN{Column: column, Values: values}}})
    			}
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Feb 01 06:40:55 UTC 2023
    - 4.5K bytes
    - Viewed (1)
  5. schema/utils.go

    		for k, v := range rm {
    			resultsMap[k] = append(resultsMap[k], v...)
    		}
    		results = append(results, rs...)
    	}
    	return resultsMap, results
    }
    
    // ToQueryValues to query values
    func ToQueryValues(table string, foreignKeys []string, foreignValues [][]interface{}) (interface{}, []interface{}) {
    	queryValues := make([]interface{}, len(foreignValues))
    	if len(foreignKeys) == 1 {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Sat Aug 19 13:35:14 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  6. callbacks/update.go

    							break
    						}
    					}
    				}
    
    				if !isZero {
    					_, primaryValues := schema.GetIdentityFieldValuesMap(stmt.Context, stmt.ReflectValue, stmt.Schema.PrimaryFields)
    					column, values := schema.ToQueryValues("", stmt.Schema.PrimaryFieldDBNames, primaryValues)
    					stmt.AddClause(clause.Where{Exprs: []clause.Expression{clause.IN{Column: column, Values: values}}})
    				}
    			}
    		case reflect.Struct:
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Mar 18 05:44:55 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  7. schema/relationship.go

    				foreignFields = append(foreignFields, ref.ForeignKey)
    			}
    		}
    	}
    
    	_, foreignValues := GetIdentityFieldValuesMap(ctx, reflectValue, foreignFields)
    	column, values := ToQueryValues(table, relForeignKeys, foreignValues)
    
    	conds = append(conds, clause.IN{Column: column, Values: values})
    	return
    }
    
    func copyableDataType(str DataType) bool {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 03:46:59 UTC 2024
    - 22.7K bytes
    - Viewed (0)
Back to top