- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 48 for Tx (0.01 sec)
-
tests/associations_belongs_to_test.go
} type BelongsToUser struct { OrgID string Org Org `gorm:"default:NULL"` } tx := DB.Session(&gorm.Session{}) tx.Config.DisableForeignKeyConstraintWhenMigrating = true AssertEqual(t, DB.Config.DisableForeignKeyConstraintWhenMigrating, false) tx.Migrator().DropTable(&BelongsToUser{}, &Org{}) tx.AutoMigrate(&BelongsToUser{}, &Org{}) user := &BelongsToUser{ Org: Org{
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Oct 30 09:15:49 UTC 2023 - 9.3K bytes - Viewed (0) -
tests/sql_builder_test.go
user.UpdatedAt = date sql = DB.ToSQL(func(tx *gorm.DB) *gorm.DB { return tx.Model(&User{}).Where("id = ?", 100).Updates(user) }) assertEqualSQL(t, `UPDATE "users" SET "created_at"='2021-10-18 00:00:00',"updated_at"='2021-10-18 19:50:09.438',"name"='bar',"age"=22 WHERE id = 100 AND "users"."deleted_at" IS NULL`, sql) // update sql = DB.ToSQL(func(tx *gorm.DB) *gorm.DB { return tx.Model(&User{}).Where("id = ?", 100).Update("name", "Foo bar")
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Jul 21 02:46:58 UTC 2025 - 16.7K bytes - Viewed (0) -
cmd/bucket-stats.go
LastFailedCount: atomic.LoadUint64(&r.mrfStats.LastFailedCount), } r.RLock() defer r.RUnlock() tx := newXferStats() for _, brs := range r.Cache { for _, v := range brs.Stats { tx := tx.merge(*v.XferRateLrg) tx = tx.merge(*v.XferRateSml) } } qs.XferStats[Total] = *tx return qs } // ReplicationQueueStats holds overall queue stats for replication
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Fri Aug 29 02:39:48 UTC 2025 - 13.5K bytes - Viewed (0) -
tests/submodel_test.go
"gorm.io/gorm" ) type Man struct { ID int Age int Name string Detail string } // Panic-safe BeforeUpdate hook that checks for Changed("age") func (m *Man) BeforeUpdate(tx *gorm.DB) (err error) { if !tx.Statement.Changed("age") { return nil } return nil } func TestSubModel(t *testing.T) { man := Man{Age: 18, Name: "random-name"} if err := DB.Create(&man).Error; err != nil {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Wed Aug 20 04:51:17 UTC 2025 - 944 bytes - Viewed (0) -
tests/connection_test.go
setSQL, getSQL := getSetSQL(DB.Dialector.Name()) if len(setSQL) == 0 || len(getSQL) == 0 { return } err := DB.Connection(func(tx *gorm.DB) error { if err := tx.Exec(setSQL, expectedName).Error; err != nil { return err } if err := tx.Raw(getSQL).Scan(&actualName).Error; err != nil { return err } return nil }) if err != nil {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Fri Jan 28 14:16:42 UTC 2022 - 963 bytes - Viewed (0) -
tests/count_test.go
if count1 != 1 || count2 != 3 { t.Errorf("multiple count in chain should works") } tx := DB.Model(&User{}).Where("name = ?", user1.Name).Session(&gorm.Session{}) tx.Count(&count1) tx.Or("name in ?", []string{user2.Name, user3.Name}).Count(&count2) if count1 != 1 || count2 != 3 { t.Errorf("count after new session should works") } var count3 int64
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Oct 30 09:15:49 UTC 2023 - 6.9K bytes - Viewed (0) -
tests/scanner_valuer_test.go
ExampleStructPtr: &ExampleStruct{"name", "value2"}, } var result ScannerValuerStruct tx := DB.Where(data).FirstOrCreate(&result) if tx.RowsAffected != 1 { t.Errorf("RowsAffected should be 1 after create some record") } if tx.Error != nil { t.Errorf("Should not raise any error, but got %v", tx.Error) } AssertObjEqual(t, result, data, "Name", "Gender", "Age")
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Wed Jun 07 07:02:07 UTC 2023 - 10.6K bytes - Viewed (0) -
src/test/java/jcifs/smb1/smb1/SmbComTransactionResponseTest.java
@Test public void readBytesWireFormat_succeedsWithSingleRead() { DummyResponse d = new DummyResponse(); // Allocate a transaction buffer large enough for the copy byte[] tx = new byte[100]; d.txn_buf = tx; // Set up a scenario where the full transaction is read in one call d.bufParameterStart = 0; d.bufDataStart = 20; d.totalParameterCount = 5; // Total parameter count
Registered: Sun Sep 07 00:10:21 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 12K bytes - Viewed (0) -
callbacks/query.go
for _, join := range db.Statement.Joins { joins = append(joins, join.Name) } tx := preloadDB(db, db.Statement.ReflectValue, db.Statement.Dest) if tx.Error != nil { return } db.AddError(preloadEntryPoint(tx, joins, &tx.Statement.Schema.Relationships, db.Statement.Preloads, db.Statement.Preloads[clause.Associations])) } } func AfterQuery(db *gorm.DB) {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Sun May 25 07:40:40 UTC 2025 - 10.4K bytes - Viewed (1) -
callbacks/create.go
callMethod(db, func(value interface{}, tx *gorm.DB) (called bool) { if db.Statement.Schema.BeforeSave { if i, ok := value.(BeforeSaveInterface); ok { called = true db.AddError(i.BeforeSave(tx)) } } if db.Statement.Schema.BeforeCreate { if i, ok := value.(BeforeCreateInterface); ok { called = true db.AddError(i.BeforeCreate(tx)) } } return called }) }
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Jul 29 11:06:13 UTC 2025 - 13K bytes - Viewed (0)