Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 44 for _values (0.66 sec)

  1. statement.go

    					case reflect.Slice, reflect.Array:
    						// optimize reflect value length
    						valueLen := reflectValue.Len()
    						values := make([]interface{}, valueLen)
    						for i := 0; i < valueLen; i++ {
    							values[i] = reflectValue.Index(i).Interface()
    						}
    
    						if len(values) > 0 {
    							conds = append(conds, clause.IN{Column: clause.PrimaryColumn, Values: values})
    							return []clause.Expression{clause.And(conds...)}
    						}
    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)
  2. callbacks/helper.go

    		}
    	}
    
    	sort.Strings(columns)
    	values.Values = make([][]interface{}, len(mapValues))
    	values.Columns = make([]clause.Column, len(columns))
    	for idx, column := range columns {
    		values.Columns[idx] = clause.Column{Name: column}
    
    		for i, v := range result[column] {
    			if len(values.Values[i]) == 0 {
    				values.Values[i] = make([]interface{}, len(columns))
    			}
    
    			values.Values[i][idx] = v
    		}
    	}
    	return
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 14 12:32:57 GMT 2022
    - 3.7K bytes
    - Viewed (0)
  3. callbacks/preload.go

    	column, values := schema.ToQueryValues(clause.CurrentTable, relForeignKeys, foreignValues)
    
    	if len(values) != 0 {
    		for _, cond := range conds {
    			if fc, ok := cond.(func(*gorm.DB) *gorm.DB); ok {
    				tx = fc(tx)
    			} else {
    				inlineConds = append(inlineConds, cond)
    			}
    		}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  4. callbacks/update.go

    				}
    			}
    		}
    	}
    
    	switch value := updatingValue.Interface().(type) {
    	case map[string]interface{}:
    		set = make([]clause.Assignment, 0, len(value))
    
    		keys := make([]string, 0, len(value))
    		for k := range value {
    			keys = append(keys, k)
    		}
    		sort.Strings(keys)
    
    		for _, k := range keys {
    			kv := value[k]
    			if _, ok := kv.(*gorm.DB); ok {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 05:44:55 GMT 2024
    - 9.4K bytes
    - Viewed (1)
  5. interfaces.go

    	Commit() error
    	Rollback() error
    }
    
    // Tx sql.Tx interface
    type Tx interface {
    	ConnPool
    	TxCommitter
    	StmtContext(ctx context.Context, stmt *sql.Stmt) *sql.Stmt
    }
    
    // Valuer gorm valuer interface
    type Valuer interface {
    	GormValue(context.Context, *DB) clause.Expr
    }
    
    // GetDBConnector SQL db connector
    type GetDBConnector interface {
    	GetDBConn() (*sql.DB, error)
    }
    
    // Rows rows interface
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Aug 19 13:33:31 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  6. utils/tests/dummy_dialecter.go

    func (DummyDialector) Name() string {
    	return "dummy"
    }
    
    func (DummyDialector) Initialize(db *gorm.DB) error {
    	callbacks.RegisterDefaultCallbacks(db, &callbacks.Config{
    		CreateClauses:        []string{"INSERT", "VALUES", "ON CONFLICT", "RETURNING"},
    		UpdateClauses:        []string{"UPDATE", "SET", "WHERE", "RETURNING"},
    		DeleteClauses:        []string{"DELETE", "FROM", "WHERE", "RETURNING"},
    		LastInsertIDReversed: true,
    	})
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 06 06:03:31 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  7. callbacks/callbacks.go

    package callbacks
    
    import (
    	"gorm.io/gorm"
    )
    
    var (
    	createClauses = []string{"INSERT", "VALUES", "ON CONFLICT"}
    	queryClauses  = []string{"SELECT", "FROM", "WHERE", "GROUP BY", "ORDER BY", "LIMIT", "FOR"}
    	updateClauses = []string{"UPDATE", "SET", "WHERE"}
    	deleteClauses = []string{"DELETE", "FROM", "WHERE"}
    )
    
    type Config struct {
    	LastInsertIDReversed bool
    	CreateClauses        []string
    	QueryClauses         []string
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Oct 27 23:56:55 GMT 2021
    - 3.3K bytes
    - Viewed (0)
  8. tests/serializer_test.go

    	switch value := dbValue.(type) {
    	case []byte:
    		*es = EncryptedString(bytes.TrimPrefix(value, []byte("hello")))
    	case string:
    		*es = EncryptedString(strings.TrimPrefix(value, "hello"))
    	default:
    		return fmt.Errorf("unsupported data %#v", dbValue)
    	}
    	return nil
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 21 14:09:38 GMT 2023
    - 7.6K bytes
    - Viewed (0)
  9. clause/values.go

    		builder.WriteString(" VALUES ")
    
    		for idx, value := range values.Values {
    			if idx > 0 {
    				builder.WriteByte(',')
    			}
    
    			builder.WriteByte('(')
    			builder.AddVar(builder, value...)
    			builder.WriteByte(')')
    		}
    	} else {
    		builder.WriteString("DEFAULT VALUES")
    	}
    }
    
    // MergeClause merge values clauses
    func (values Values) MergeClause(clause *Clause) {
    	clause.Name = ""
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sun May 24 03:35:19 GMT 2020
    - 849 bytes
    - Viewed (0)
  10. association.go

    			if pcolumn, pvalues := schema.ToQueryValues(rel.Schema.Table, rel.Schema.PrimaryFieldDBNames, pvs); len(pvalues) > 0 {
    				conds = append(conds, clause.IN{Column: pcolumn, Values: pvalues})
    			} else {
    				return ErrPrimaryKeyRequired
    			}
    
    			_, rvs := schema.GetIdentityFieldValuesMapFromValues(association.DB.Statement.Context, values, primaryFields)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu May 04 11:30:45 GMT 2023
    - 21.2K bytes
    - Viewed (0)
Back to top