- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 18 for Tx (0.01 sec)
-
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) -
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) -
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/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) -
tests/generics_test.go
ctx := context.Background() tx := DB.Begin() if tx.Error != nil { t.Fatalf("failed to begin transaction: %v", tx.Error) } users := []User{{Name: "TestGenericsTransaction", Age: 18}, {Name: "TestGenericsTransaction2", Age: 18}} err := gorm.G[User](tx).CreateInBatches(ctx, &users, 2) count, err := gorm.G[User](tx).Where("name like ?", "TestGenericsTransaction%").Count(ctx, "*")
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Sep 04 13:13:16 UTC 2025 - 28K bytes - Viewed (0) -
generics.go
}) } func (c chainG[T]) Preload(association string, query func(db PreloadBuilder) error) ChainInterface[T] { return c.with(func(db *DB) *DB { return db.Preload(association, func(tx *DB) *DB { q := preloadBuilder{db: tx.getInstance()} if query != nil { if err := query(&q); err != nil { db.AddError(err) } } relation, ok := db.Statement.Schema.Relationships.Relations[association]
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Sep 04 13:13:16 UTC 2025 - 15.5K bytes - Viewed (0) -
tests/upsert_test.go
} user := User{ID: 1, Name: "king"} tx := DB.Session(&gorm.Session{DryRun: true}).Save(&user) if err := tx.Error; err != nil { t.Fatalf("failed to update user,missing where condition,err=%+v", err) } if !regexp.MustCompile("WHERE .id. = [^ ]+$").MatchString(tx.Statement.SQL.String()) { t.Fatalf("invalid updating SQL, got %v", tx.Statement.SQL.String()) }
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Jul 29 11:06:13 UTC 2025 - 13.1K bytes - Viewed (0)