- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 60 for Map (0.13 sec)
-
schema/serializer.go
package schema import ( "bytes" "context" "database/sql" "database/sql/driver" "encoding/gob" "encoding/json" "fmt" "reflect" "strings" "sync" "time" ) var serializerMap = sync.Map{} // RegisterSerializer register serializer func RegisterSerializer(name string, serializer SerializerInterface) { serializerMap.Store(strings.ToLower(name), serializer) } // GetSerializer get serializer
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) -
clause/benchmarks_test.go
"gorm.io/gorm/schema" "gorm.io/gorm/utils/tests" ) func BenchmarkSelect(b *testing.B) { user, _ := schema.Parse(&tests.User{}, &sync.Map{}, db.NamingStrategy) for i := 0; i < b.N; i++ { stmt := gorm.Statement{DB: db, Table: user.Table, Schema: user, Clauses: map[string]clause.Clause{}}
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Oct 07 12:14:14 GMT 2022 - 1.9K bytes - Viewed (0) -
schema/schema_helper_test.go
} }) } type EmbeddedRelations struct { Relations map[string]Relation EmbeddedRelations map[string]EmbeddedRelations } func checkEmbeddedRelations(t *testing.T, actual map[string]*schema.Relationships, expected map[string]EmbeddedRelations) { for name, relations := range actual { rs := expected[name]
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Dec 15 08:31:23 GMT 2023 - 7.5K bytes - Viewed (0) -
callbacks/associations.go
if !ref.OwnPrimaryKey { 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() } } } } }
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) -
callbacks/create_test.go
package callbacks import ( "reflect" "sync" "testing" "time" "gorm.io/gorm" "gorm.io/gorm/clause" "gorm.io/gorm/schema" ) var schemaCache = &sync.Map{} func TestConvertToCreateValues_DestType_Slice(t *testing.T) { type user struct { ID int `gorm:"primaryKey"` Name string Email string `gorm:"default:(-)"` Age int `gorm:"default:(-)"` }
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) -
callbacks/create.go
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{}: mapValues, ok := values.([]map[string]interface{}) if !ok { if v, ok := values.(*[]map[string]interface{}); ok { if *v != nil { mapValues = *v }
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) -
clause/set.go
func (set Set) MergeClause(clause *Clause) { copiedAssignments := make([]Assignment, len(set)) copy(copiedAssignments, set) clause.Expression = Set(copiedAssignments) } func Assignments(values map[string]interface{}) Set { keys := make([]string, 0, len(values)) for key := range values { keys = append(keys, key) } sort.Strings(keys) assignments := make([]Assignment, len(keys))
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Nov 29 03:02:44 GMT 2021 - 1.4K bytes - Viewed (0) -
finisher_api.go
} } } else if andCond, ok := expr.(clause.AndConditions); ok { db.assignInterfacesToValue(andCond.Exprs) } } case clause.Expression, map[string]string, map[interface{}]interface{}, map[string]interface{}: if exprs := db.Statement.BuildCondition(value); len(exprs) > 0 { db.assignInterfacesToValue(exprs) } default:
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) -
clause/expression.go
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Oct 10 06:45:48 GMT 2023 - 8.3K bytes - Viewed (0) -
tests/hooks_test.go
} DB.Model(&product).Select("code", "price").Updates(map[string]interface{}{"code": "L1212"}) if product.Price != 150 || product.Code != "L1212" { t.Errorf("invalid data after update, got %+v", product) } // Code not changed, price should not change DB.Model(&product).Updates(map[string]interface{}{"Name": "Product New"})
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Sat Feb 18 01:20:29 GMT 2023 - 15.9K bytes - Viewed (0)