- Sort Score
- Num 10 results
- Language All
Results 31 - 40 of 1,236 for gorm (0.02 seconds)
-
logger/slog_test.go
return "select count(*) from users", 0 }, nil) if strings.Contains(buf.String(), "gorm/logger/slog.go") { t.Error("Found internal slog.go reference in caller frame. Expected only test file references.") } if !strings.Contains(buf.String(), "gorm/logger/slog_test.go") { t.Error("Missing expected test file reference. 'gorm/logger/slog_test.go' should appear in caller frames.") }
Created: Sun Apr 05 09:35:12 GMT 2026 - Last Modified: Thu Oct 30 10:56:26 GMT 2025 - 782 bytes - Click Count (0) -
schema/model_test.go
import ( "database/sql" "time" "gorm.io/gorm" "gorm.io/gorm/utils/tests" ) type User struct { *gorm.Model Name *string Age *uint Birthday *time.Time Account *tests.Account Pets []*tests.Pet Toys []*tests.Toy `gorm:"polymorphic:Owner"` CompanyID *int Company *tests.Company ManagerID *uint Manager *User Team []*User `gorm:"foreignkey:ManagerID"`
Created: Sun Apr 05 09:35:12 GMT 2026 - Last Modified: Thu Jan 06 07:02:53 GMT 2022 - 1.1K bytes - Click Count (0) -
schema/callbacks_test.go
package schema_test import ( "reflect" "sync" "testing" "gorm.io/gorm" "gorm.io/gorm/schema" ) type UserWithCallback struct{} func (UserWithCallback) BeforeSave(*gorm.DB) error { return nil } func (UserWithCallback) AfterCreate(*gorm.DB) error { return nil } func TestCallback(t *testing.T) { user, err := schema.Parse(&UserWithCallback{}, &sync.Map{}, schema.NamingStrategy{}) if err != nil {
Created: Sun Apr 05 09:35:12 GMT 2026 - Last Modified: Thu Jan 06 07:02:53 GMT 2022 - 939 bytes - Click Count (0) -
schema/utils.go
package schema import ( "context" "fmt" "reflect" "regexp" "strings" "gorm.io/gorm/clause" "gorm.io/gorm/utils" ) var embeddedCacheKey = "embedded_cache_store" func ParseTagSetting(str string, sep string) map[string]string { settings := map[string]string{} names := strings.Split(str, sep) var parsedNames []string for i := 0; i < len(names); i++ { s := names[i]
Created: Sun Apr 05 09:35:12 GMT 2026 - Last Modified: Thu Oct 30 11:15:36 GMT 2025 - 5.9K bytes - Click Count (0) -
tests/compose.yml
environment: - MYSQL_DATABASE=gorm - MYSQL_USER=gorm - MYSQL_PASSWORD=gorm - MYSQL_RANDOM_ROOT_PASSWORD="yes" postgres: image: 'postgres:latest' ports: - "127.0.0.1:9920:5432" environment: - TZ=Asia/Shanghai - POSTGRES_DB=gorm - POSTGRES_USER=gorm - POSTGRES_PASSWORD=gorm mssql: image: '${MSSQL_IMAGE}:latest' ports:Created: Sun Apr 05 09:35:12 GMT 2026 - Last Modified: Mon Aug 04 04:07:30 GMT 2025 - 1.9K bytes - Click Count (0) -
tests/chainable_api_test.go
package tests import ( "context" "testing" "gorm.io/gorm" "gorm.io/gorm/clause" "gorm.io/gorm/schema" ) // testDialector is a minimal Dialector implementation used only for unit tests in-memory. type testDialector struct{} func (d testDialector) Name() string { return "test" } func (d testDialector) Initialize(*gorm.DB) error { return nil }
Created: Sun Apr 05 09:35:12 GMT 2026 - Last Modified: Sat Jan 31 08:39:40 GMT 2026 - 3.9K bytes - Click Count (0) -
tests/gorm_test.go
package tests_test import ( "testing" "gorm.io/driver/mysql" "gorm.io/gorm" ) func TestOpen(t *testing.T) { dsn := "gorm:gorm@tcp(localhost:9910)/gorm?loc=Asia%2FHongKong" // invalid loc _, err := gorm.Open(mysql.Open(dsn), &gorm.Config{}) if err == nil { t.Fatalf("should returns error but got nil") } } func TestReturningWithNullToZeroValues(t *testing.T) { dialect := DB.Dialector.Name() switch dialect {
Created: Sun Apr 05 09:35:12 GMT 2026 - Last Modified: Thu Jun 01 07:22:21 GMT 2023 - 3.3K bytes - Click Count (0) -
tests/preload_suits_test.go
} type ( Level1 struct { ID uint `gorm:"primary_key;"` LanguageCode string `gorm:"primary_key"` Value string } Level2 struct { ID uint `gorm:"primary_key;"` LanguageCode string `gorm:"primary_key"` Value string Level1s []Level1 `gorm:"many2many:levels;"` } ) DB.Migrator().DropTable(&Level2{}, &Level1{})
Created: Sun Apr 05 09:35:12 GMT 2026 - Last Modified: Thu Jun 05 11:34:13 GMT 2025 - 30.4K bytes - Click Count (0) -
utils/utils.go
// Package utils provides internal utility functions for GORM. package utils import ( "database/sql/driver" "fmt" "path/filepath" "reflect" "runtime" "strconv" "strings" "unicode" ) var gormSourceDir string func init() { _, file, _, _ := runtime.Caller(0) // compatible solution to get gorm source directory with various operating systems gormSourceDir = sourceDir(file) }
Created: Sun Apr 05 09:35:12 GMT 2026 - Last Modified: Sat Mar 21 11:35:55 GMT 2026 - 4.9K bytes - Click Count (0) -
tests/joins_table_test.go
import ( "testing" "time" "gorm.io/gorm" "gorm.io/gorm/clause" ) type Person struct { ID int Name string Addresses []Address `gorm:"many2many:person_addresses;"` DeletedAt gorm.DeletedAt } type Address struct { ID uint Name string } type PersonAddress struct { PersonID int AddressID int CreatedAt time.Time DeletedAt gorm.DeletedAt }
Created: Sun Apr 05 09:35:12 GMT 2026 - Last Modified: Thu Sep 10 13:46:18 GMT 2020 - 3.5K bytes - Click Count (1)