Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 93 for dest (0.14 sec)

  1. scan.go

    	)
    
    	db.RowsAffected = 0
    
    	switch dest := db.Statement.Dest.(type) {
    	case map[string]interface{}, *map[string]interface{}:
    		if initialized || rows.Next() {
    			columnTypes, _ := rows.ColumnTypes()
    			prepareValues(values, db, columnTypes, columns)
    
    			db.RowsAffected++
    			db.AddError(rows.Scan(values...))
    
    			mapValue, ok := dest.(map[string]interface{})
    			if !ok {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 09:53:11 GMT 2024
    - 9.8K bytes
    - Viewed (0)
  2. callbacks.go

    		stmt.BuildClauses = p.Clauses
    		resetBuildClauses = true
    	}
    
    	if optimizer, ok := db.Statement.Dest.(StatementModifier); ok {
    		optimizer.ModifyStatement(stmt)
    	}
    
    	// assign model values
    	if stmt.Model == nil {
    		stmt.Model = stmt.Dest
    	} else if stmt.Dest == nil {
    		stmt.Dest = stmt.Model
    	}
    
    	// parse model values
    	if stmt.Model != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 8.6K bytes
    - Viewed (1)
  3. callbacks/create_test.go

    			Config: &gorm.Config{
    				NowFunc: func() time.Time { return time.Time{} },
    			},
    			Statement: &gorm.Statement{
    				Settings: sync.Map{},
    				Schema:   s,
    			},
    		},
    		ReflectValue: reflect.ValueOf(dest),
    		Dest:         dest,
    	}
    
    	stmt.Schema = s
    
    	values := ConvertToCreateValues(stmt)
    	expected := clause.Values{
    		// column has value + defaultValue column has value (which should have a stable order)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 05:48:42 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  4. finisher_api.go

    		})
    	}
    	tx.Statement.Dest = dest
    	return tx.callbacks.Query().Execute(tx)
    }
    
    func (db *DB) ScanRows(rows *sql.Rows, dest interface{}) error {
    	tx := db.getInstance()
    	if err := tx.Statement.Parse(dest); !errors.Is(err, schema.ErrUnsupportedDataType) {
    		tx.AddError(err)
    	}
    	tx.Statement.Dest = dest
    	tx.Statement.ReflectValue = reflect.ValueOf(dest)
    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)
  5. callbacks/associations.go

    							pv, _ := ref.PrimaryKey.ValueOf(db.Statement.Context, elem)
    							db.AddError(ref.ForeignKey.Set(db.Statement.Context, obj, pv))
    
    							if dest, ok := db.Statement.Dest.(map[string]interface{}); ok {
    								dest[ref.ForeignKey.DBName] = pv
    								if _, ok := dest[rel.Name]; ok {
    									dest[rel.Name] = elem.Interface()
    								}
    							}
    						}
    					}
    				}
    
    				switch db.Statement.ReflectValue.Kind() {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Apr 11 03:06:13 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  6. callbacks/query.go

    					queryFields = db.Statement.ReflectValue.Type().Elem() != db.Statement.Schema.ModelType
    				}
    			}
    
    			if queryFields {
    				stmt := gorm.Statement{DB: db}
    				// smaller struct
    				if err := stmt.Parse(db.Statement.Dest); err == nil && (db.QueryFields || stmt.Schema.ModelType != db.Statement.Schema.ModelType) {
    					clauseSelect.Columns = make([]clause.Column, len(stmt.Schema.DBNames))
    
    					for idx, dbName := range stmt.Schema.DBNames {
    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)
  7. soft_delete.go

    			if len(values) > 0 {
    				stmt.AddClause(clause.Where{Exprs: []clause.Expression{clause.IN{Column: column, Values: values}}})
    			}
    
    			if stmt.ReflectValue.CanAddr() && stmt.Dest != stmt.Model && stmt.Model != nil {
    				_, queryValues = schema.GetIdentityFieldValuesMap(stmt.Context, reflect.ValueOf(stmt.Model), stmt.Schema.PrimaryFields)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Feb 01 06:40:55 GMT 2023
    - 4.5K bytes
    - Viewed (0)
  8. callbacks/create.go

    		}
    
    		// append @id column with value for auto-increment primary key
    		// the @id value is correct, when: 1. without setting auto-increment primary key, 2. database AutoIncrementIncrement = 1
    		switch values := db.Statement.Dest.(type) {
    		case map[string]interface{}:
    			values[pkFieldName] = insertID
    		case *map[string]interface{}:
    			(*values)[pkFieldName] = insertID
    		case []map[string]interface{}, *[]map[string]interface{}:
    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)
  9. callbacks/delete.go

    				if len(values) > 0 {
    					db.Statement.AddClause(clause.Where{Exprs: []clause.Expression{clause.IN{Column: column, Values: values}}})
    				}
    
    				if db.Statement.ReflectValue.CanAddr() && db.Statement.Dest != db.Statement.Model && db.Statement.Model != nil {
    					_, queryValues = schema.GetIdentityFieldValuesMap(db.Statement.Context, reflect.ValueOf(db.Statement.Model), db.Statement.Schema.PrimaryFields)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Feb 25 02:48:23 GMT 2022
    - 5.6K bytes
    - Viewed (0)
  10. migrator/migrator.go

    func (m Migrator) GetIndexes(dst interface{}) ([]gorm.Index, error) {
    	return nil, errors.New("not support")
    }
    
    // GetTypeAliases return database type aliases
    func (m Migrator) GetTypeAliases(databaseTypeName string) []string {
    	return nil
    }
    
    // TableType return tableType gorm.TableType and execErr error
    func (m Migrator) TableType(dst interface{}) (gorm.TableType, error) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
Back to top