Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for Case (0.46 sec)

  1. 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)
  2. 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)
  3. chainable_api.go

    	tx = db.getInstance()
    
    	switch v := query.(type) {
    	case []string:
    		tx.Statement.Selects = v
    
    		for _, arg := range args {
    			switch arg := arg.(type) {
    			case string:
    				tx.Statement.Selects = append(tx.Statement.Selects, arg)
    			case []string:
    				tx.Statement.Selects = append(tx.Statement.Selects, arg...)
    			default:
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  4. migrator/migrator.go

    			// null -> default value
    			alterColumn = true
    		} else if currentDefaultNotNull || dvNotNull {
    			switch field.GORMDataType {
    			case schema.Time:
    				if !strings.EqualFold(strings.TrimSuffix(dv, "()"), strings.TrimSuffix(field.DefaultValue, "()")) {
    					alterColumn = true
    				}
    			case schema.Bool:
    				v1, _ := strconv.ParseBool(dv)
    				v2, _ := strconv.ParseBool(field.DefaultValue)
    				alterColumn = v1 != v2
    			default:
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  5. callbacks/query.go

    			queryFields := db.QueryFields
    			if !queryFields {
    				switch db.Statement.ReflectValue.Kind() {
    				case reflect.Struct:
    					queryFields = db.Statement.ReflectValue.Type() != db.Statement.Schema.ModelType
    				case reflect.Slice:
    					queryFields = db.Statement.ReflectValue.Type().Elem() != db.Statement.Schema.ModelType
    				}
    			}
    
    			if queryFields {
    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)
  6. callbacks/create.go

    	curTime := stmt.DB.NowFunc()
    
    	switch value := stmt.Dest.(type) {
    	case map[string]interface{}:
    		values = ConvertMapToValuesForCreate(stmt, value)
    	case *map[string]interface{}:
    		values = ConvertMapToValuesForCreate(stmt, *value)
    	case []map[string]interface{}:
    		values = ConvertSliceOfMapToValuesForCreate(stmt, value)
    	case *[]map[string]interface{}:
    		values = ConvertSliceOfMapToValuesForCreate(stmt, *value)
    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)
  7. finisher_api.go

    		switch v := value.(type) {
    		case []clause.Expression:
    			for _, expr := range v {
    				if eq, ok := expr.(clause.Eq); ok {
    					switch column := eq.Column.(type) {
    					case string:
    						if field := db.Statement.Schema.LookUpField(column); field != nil {
    							db.AddError(field.Set(db.Statement.Context, db.Statement.ReflectValue, eq.Value))
    						}
    					case clause.Column:
    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)
  8. statement.go

    			}
    		case clause.Interface:
    			c := clause.Clause{Name: v.Name()}
    			v.MergeClause(&c)
    			c.Build(stmt)
    		case clause.Expression:
    			v.Build(stmt)
    		case driver.Valuer:
    			stmt.Vars = append(stmt.Vars, v)
    			stmt.DB.Dialector.BindVarTo(writer, stmt, v)
    		case []byte:
    			stmt.Vars = append(stmt.Vars, v)
    			stmt.DB.Dialector.BindVarTo(writer, stmt, v)
    		case []interface{}:
    			if len(v) > 0 {
    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)
  9. 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)
  10. schema/schema_test.go

    		{Name: "ID", DBName: "company_id", BindNames: []string{"Base", "ID"}, DataType: schema.Int, Size: 64, TagSettings: map[string]string{"EMBEDDED": "EMBEDDED", "EMBEDDEDPREFIX": "company_"}},
    		{Name: "Name", DBName: "company_name", BindNames: []string{"Base", "Name"}, DataType: schema.String, TagSettings: map[string]string{"EMBEDDED": "EMBEDDED", "EMBEDDEDPREFIX": "company_"}},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
Back to top