- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 27 for Tx (0.01 sec)
-
callbacks/preload.go
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Sun May 25 07:40:40 UTC 2025 - 11.7K bytes - Viewed (0) -
chainable_api.go
func (db *DB) Select(query interface{}, args ...interface{}) (tx *DB) { 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:
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Sun May 25 07:40:40 UTC 2025 - 14.8K bytes - Viewed (0) -
association.go
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Wed Jun 12 10:49:45 UTC 2024 - 21.5K bytes - Viewed (0) -
tests/hooks_test.go
Owner string } func (s Product3) BeforeCreate(tx *gorm.DB) (err error) { tx.Statement.SetColumn("Price", s.Price+100) return nil } func (s Product3) BeforeUpdate(tx *gorm.DB) (err error) { if tx.Statement.Changed() { tx.Statement.SetColumn("Price", s.Price+10) } if tx.Statement.Changed("Code") { s.Price += 20 tx.Statement.SetColumn("Price", s.Price+30) } return nil }
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Jun 17 03:59:06 UTC 2024 - 16.7K bytes - Viewed (0) -
finisher_api.go
tx := db.getInstance().Set("rows", false) tx = tx.callbacks.Row().Execute(tx) row, ok := tx.Statement.Dest.(*sql.Row) if !ok && tx.DryRun { db.Logger.Error(tx.Statement.Context, ErrDryRunModeUnsupported.Error()) } return row } func (db *DB) Rows() (*sql.Rows, error) { tx := db.getInstance().Set("rows", true) tx = tx.callbacks.Row().Execute(tx) rows, ok := tx.Statement.Dest.(*sql.Rows)
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Aug 26 06:24:29 UTC 2025 - 22.9K bytes - Viewed (0) -
gorm.go
func (db *DB) Debug() (tx *DB) { tx = db.getInstance() return tx.Session(&Session{ Logger: db.Logger.LogMode(logger.Info), }) } // Set store value with key into current db instance's context func (db *DB) Set(key string, value interface{}) *DB { tx := db.getInstance() tx.Statement.Settings.Store(key, value) return tx } // Get get value with key from current db instance's context
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Aug 26 06:24:29 UTC 2025 - 12.8K bytes - Viewed (0) -
callbacks/associations.go
tx = tx.Set("gorm:update_track_time", true) } if len(selects) > 0 { tx = tx.Select(selects) } else if restricted && len(omits) == 0 { tx = tx.Omit(clause.Associations) } if len(omits) > 0 { tx = tx.Omit(omits...) } return db.AddError(tx.Create(values).Error) } // check association values has been saved // if values kind is Struct, check it has been saved
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Feb 13 06:16:26 UTC 2025 - 14.4K bytes - Viewed (0) -
tests/transaction_test.go
if err := tx.Save(&user1).Error; err != nil { t.Fatalf("No error should raise, but got %v", err) } if err := tx.First(&User{}, "name = ?", user1.Name).Error; err != nil { t.Fatalf("Should find saved record, but got %v", err) } if sqlTx, ok := tx.Statement.ConnPool.(gorm.TxCommitter); !ok || sqlTx == nil { t.Fatalf("Should return the underlying sql.Tx") } tx.Rollback()
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Sun May 25 07:40:40 UTC 2025 - 13.3K bytes - Viewed (0) -
tests/associations_has_many_test.go
Contents []ItemContent `gorm:"foreignKey:ItemID"` } tx := DB.Session(&gorm.Session{}) tx.Migrator().DropTable(&ItemContent{}, &Item{}) tx.AutoMigrate(&ItemContent{}, &Item{}) item := Item{ Logo: "logo", Contents: []ItemContent{ {Name: "name", LanguageCode: "en"}, {Name: "ar name", LanguageCode: "ar"}, }, } if err := tx.Create(&item).Error; err != nil {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Wed Jun 12 10:49:45 UTC 2024 - 16K bytes - Viewed (0) -
tests/preload_test.go
expect: org, }, } for _, test := range tests { t.Run(test.name, func(t *testing.T) { actual := Org{} tx := DB.Where("id = ?", org.ID).Session(&gorm.Session{}) for name, args := range test.preloads { tx = tx.Preload(name, args...) } if err := tx.Find(&actual).Error; err != nil { t.Errorf("failed to find org, got err: %v", err) } AssertEqual(t, actual, test.expect) })
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Wed Jun 12 10:00:47 UTC 2024 - 15.9K bytes - Viewed (0)