- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 446 for gorm (0.09 sec)
-
gorm.go
package gorm import ( "context" "database/sql" "fmt" "reflect" "sort" "sync" "time" "gorm.io/gorm/clause" "gorm.io/gorm/logger" "gorm.io/gorm/schema" ) // for Config.cacheStore store PreparedStmtDB key const preparedStmtDBKey = "preparedStmt" // Config GORM config type Config struct { // GORM perform single create, update, delete operations in transactions by default to ensure database data integrity
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Aug 26 06:24:29 UTC 2025 - 12.8K bytes - Viewed (0) -
tests/error_translator_test.go
package tests_test import ( "errors" "testing" "gorm.io/gorm" "gorm.io/gorm/utils/tests" ) func TestDialectorWithErrorTranslatorSupport(t *testing.T) { // it shouldn't translate error when the TranslateError flag is false translatedErr := errors.New("translated error") untranslatedErr := errors.New("some random error") db, _ := gorm.Open(tests.DummyDialector{TranslatedErr: translatedErr}) err := db.AddError(untranslatedErr)
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Jul 21 02:46:58 UTC 2025 - 3.1K bytes - Viewed (0) -
tests/tests_test.go
"os" "path/filepath" "time" "gorm.io/driver/gaussdb" "gorm.io/driver/mysql" "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/driver/sqlserver" "gorm.io/gorm" "gorm.io/gorm/logger" . "gorm.io/gorm/utils/tests" ) var DB *gorm.DB var ( mysqlDSN = "gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True&loc=Local"
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Jul 21 02:46:58 UTC 2025 - 3.7K bytes - Viewed (0) -
tests/table_test.go
import ( "regexp" "sync" "testing" "gorm.io/driver/gaussdb" "gorm.io/driver/postgres" "gorm.io/gorm" "gorm.io/gorm/schema" "gorm.io/gorm/utils/tests" . "gorm.io/gorm/utils/tests" ) type UserWithTable struct { gorm.Model Name string } func (UserWithTable) TableName() string { return "gorm.user" } func TestTable(t *testing.T) { dryDB := DB.Session(&gorm.Session{DryRun: true})
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Jul 21 02:46:58 UTC 2025 - 12.7K bytes - Viewed (0) -
tests/generics_test.go
"sort" "strconv" "strings" "sync" "testing" "github.com/google/uuid" "gorm.io/driver/mysql" "gorm.io/gorm" "gorm.io/gorm/clause" . "gorm.io/gorm/utils/tests" ) func TestGenericsCreate(t *testing.T) { ctx := context.Background() user := User{Name: "TestGenericsCreate", Age: 18} err := gorm.G[User](DB).Create(ctx, &user) if err != nil { t.Fatalf("Create failed: %v", err) }
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Sep 04 13:13:16 UTC 2025 - 28K bytes - Viewed (0) -
tests/serializer_test.go
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Jul 21 02:46:58 UTC 2025 - 7.6K bytes - Viewed (0) -
tests/go.mod
module gorm.io/gorm/tests go 1.23.0 require ( github.com/google/uuid v1.6.0 github.com/jinzhu/now v1.1.5 github.com/lib/pq v1.10.9 github.com/stretchr/testify v1.11.1 gorm.io/driver/gaussdb v0.1.0 gorm.io/driver/mysql v1.6.0 gorm.io/driver/postgres v1.6.0 gorm.io/driver/sqlite v1.6.0 gorm.io/driver/sqlserver v1.6.1 gorm.io/gorm v1.30.2 ) require ( filippo.io/edwards25519 v1.1.0 // indirect
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Sep 04 13:13:16 UTC 2025 - 1.3K bytes - Viewed (0) -
schema/schema_test.go
package schema_test import ( "strings" "sync" "testing" "gorm.io/gorm" "gorm.io/gorm/schema" "gorm.io/gorm/utils/tests" ) func TestParseSchema(t *testing.T) { user, err := schema.Parse(&tests.User{}, &sync.Map{}, schema.NamingStrategy{}) if err != nil { t.Fatalf("failed to parse user, got error %v", err) } checkUserSchema(t, user) } func TestParseSchemaWithMap(t *testing.T) { type User struct {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Aug 28 02:57:17 UTC 2025 - 13.3K bytes - Viewed (0) -
tests/sql_builder_test.go
package tests_test import ( "regexp" "strings" "testing" "time" "gorm.io/gorm" "gorm.io/gorm/clause" . "gorm.io/gorm/utils/tests" ) func TestRow(t *testing.T) { user1 := User{Name: "RowUser1", Age: 1} user2 := User{Name: "RowUser2", Age: 10} user3 := User{Name: "RowUser3", Age: 20} DB.Save(&user1).Save(&user2).Save(&user3) row := DB.Table("users").Where("name = ?", user2.Name).Select("age").Row()
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Jul 21 02:46:58 UTC 2025 - 16.7K bytes - Viewed (0) -
callbacks/create.go
import ( "fmt" "reflect" "strings" "gorm.io/gorm" "gorm.io/gorm/clause" "gorm.io/gorm/schema" "gorm.io/gorm/utils" ) // BeforeCreate before create hooks func BeforeCreate(db *gorm.DB) { if db.Error == nil && db.Statement.Schema != nil && !db.Statement.SkipHooks && (db.Statement.Schema.BeforeSave || db.Statement.Schema.BeforeCreate) { callMethod(db, func(value interface{}, tx *gorm.DB) (called bool) {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Jul 29 11:06:13 UTC 2025 - 13K bytes - Viewed (0)