- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for title (0.14 sec)
-
tests/postgres_test.go
} DB.Migrator().DropTable(&Post{}, &Category{}, "post_categories") DB.AutoMigrate(&Post{}, &Category{}) post := Post{ Title: "Hello World", Categories: []*Category{ {Title: "Coding"}, {Title: "Golang"}, }, } if err := DB.Create(&post).Error; err != nil { t.Errorf("Failed, got error: %v", err) } }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Sat Oct 08 09:16:32 GMT 2022 - 6.4K bytes - Viewed (3) -
schema/naming.go
} ret := buf.String() return ret } func (ns NamingStrategy) toSchemaName(name string) string { result := strings.ReplaceAll(strings.Title(strings.ReplaceAll(name, "_", " ")), " ", "") for _, initialism := range commonInitialisms { result = regexp.MustCompile(strings.Title(strings.ToLower(initialism))+"([A-Z]|$|_)").ReplaceAllString(result, initialism+"$1") } return result
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Mon Oct 30 09:15:49 GMT 2023 - 5.2K bytes - Viewed (0) -
tests/serializer_test.go
if DB.Dialector.Name() == "postgres" { sps := SerializerPostgresStruct(*s) return &sps } return s } type Roles []string type Job struct { Title string Number int Location string IsIntern bool } type EncryptedString string
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Fri Apr 21 14:09:38 GMT 2023 - 7.6K bytes - Viewed (0) -
schema/relationship.go
return } } } for idx, ownField := range ownForeignFields { joinFieldName := strings.Title(schema.Name) + ownField.Name if len(joinForeignKeys) > idx { joinFieldName = strings.Title(joinForeignKeys[idx]) } ownFieldsMap[joinFieldName] = ownField fieldsMap[joinFieldName] = ownField
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Mon Apr 15 03:20:20 GMT 2024 - 22.4K bytes - Viewed (0) -
tests/embedded_struct_test.go
} } // save embedded struct DB.Save(&HNPost{BasePost: BasePost{Title: "news"}}) DB.Save(&HNPost{BasePost: BasePost{Title: "hn_news"}}) var news HNPost if err := DB.First(&news, "title = ?", "hn_news").Error; err != nil { t.Errorf("no error should happen when query with embedded struct, but got %v", err) } else if news.Title != "hn_news" { t.Errorf("embedded struct's value should be scanned correctly") }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Thu Oct 26 03:58:13 GMT 2023 - 7.3K bytes - Viewed (0)