Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for casa (0.17 sec)

  1. schema/serializer.go

    	fieldValue := reflect.New(field.FieldType)
    
    	if dbValue != nil {
    		var bytes []byte
    		switch v := dbValue.(type) {
    		case []byte:
    			bytes = v
    		case string:
    			bytes = []byte(v)
    		default:
    			return fmt.Errorf("failed to unmarshal JSONB value: %#v", dbValue)
    		}
    
    		if len(bytes) > 0 {
    			err = json.Unmarshal(bytes, fieldValue.Interface())
    		}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 08:28:46 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  2. scan.go

    		update              = mode&ScanUpdate != 0
    		onConflictDonothing = mode&ScanOnConflictDoNothing != 0
    	)
    
    	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++
    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)
  3. tests/create_test.go

    	AssertEqual(t, u2.Mobile, "133xxxx")
    }
    
    func TestCreateFromMapWithoutPK(t *testing.T) {
    	if !isMysql() {
    		t.Skipf("This test case skipped, because of only supporting for mysql")
    	}
    
    	// case 1: one record, create from map[string]interface{}
    	mapValue1 := map[string]interface{}{"name": "create_from_map_with_schema1", "age": 1}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  4. callbacks/preload.go

    	switch reflectValue.Kind() {
    	case reflect.Struct:
    		switch rel.Type {
    		case schema.HasMany, schema.Many2Many:
    			tx.AddError(rel.Field.Set(tx.Statement.Context, reflectValue, reflect.MakeSlice(rel.Field.IndirectFieldType, 0, 10).Interface()))
    		default:
    			tx.AddError(rel.Field.Set(tx.Statement.Context, reflectValue, reflect.New(rel.Field.FieldType).Interface()))
    		}
    	case reflect.Slice, reflect.Array:
    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)
  5. callbacks/update.go

    	)
    
    	switch stmt.ReflectValue.Kind() {
    	case reflect.Slice, reflect.Array:
    		assignValue = func(field *schema.Field, value interface{}) {
    			for i := 0; i < stmt.ReflectValue.Len(); i++ {
    				if stmt.ReflectValue.CanAddr() {
    					field.Set(stmt.Context, stmt.ReflectValue.Index(i), value)
    				}
    			}
    		}
    	case reflect.Struct:
    		assignValue = func(field *schema.Field, value interface{}) {
    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)
  6. schema/field.go

    				}
    			case int64:
    				field.ReflectValueOf(ctx, value).SetInt(data)
    			case int:
    				field.ReflectValueOf(ctx, value).SetInt(int64(data))
    			case int8:
    				field.ReflectValueOf(ctx, value).SetInt(int64(data))
    			case int16:
    				field.ReflectValueOf(ctx, value).SetInt(int64(data))
    			case int32:
    				field.ReflectValueOf(ctx, value).SetInt(int64(data))
    			case uint:
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  7. schema/relationship.go

    	}
    
    	reguessOrErr := func() {
    		switch cgl {
    		case guessGuess:
    			schema.guessRelation(relation, field, guessBelongs)
    		case guessBelongs:
    			schema.guessRelation(relation, field, guessEmbeddedBelongs)
    		case guessEmbeddedBelongs:
    			schema.guessRelation(relation, field, guessHas)
    		case guessHas:
    			schema.guessRelation(relation, field, guessEmbeddedHas)
    		// case guessEmbeddedHas:
    		default:
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  8. clause/where.go

    			}
    		}
    
    		if len(exprs) > 1 {
    			switch v := expr.(type) {
    			case OrConditions:
    				if len(v.Exprs) == 1 {
    					if e, ok := v.Exprs[0].(Expr); ok {
    						sql := strings.ToUpper(e.SQL)
    						wrapInParentheses = strings.Contains(sql, AndWithSpace) || strings.Contains(sql, OrWithSpace)
    					}
    				}
    			case AndConditions:
    				if len(v.Exprs) == 1 {
    					if e, ok := v.Exprs[0].(Expr); ok {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 5.1K bytes
    - Viewed (0)
  9. tests/query_test.go

    					switch name {
    					case "Name":
    						if _, ok := first[dbName].(string); !ok {
    							t.Errorf("invalid data type for %v, got %#v", dbName, first[dbName])
    						}
    					case "Age":
    						if _, ok := first[dbName].(uint); !ok {
    							t.Errorf("invalid data type for %v, got %#v", dbName, first[dbName])
    						}
    					case "Birthday":
    						if _, ok := first[dbName].(*time.Time); !ok {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
Back to top