- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 13 for Seguin (0.18 sec)
-
tests/tracer_test.go
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Tue Oct 18 09:28:06 GMT 2022 - 830 bytes - Viewed (0) -
migrator/migrator.go
gorm.Dialector } type printSQLLogger struct { logger.Interface } func (l *printSQLLogger) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) { sql, _ := fc() fmt.Println(sql + ";") l.Interface.Trace(ctx, begin, fc, err) } // GormDataTypeInterface gorm data type interface type GormDataTypeInterface interface { GormDBDataType(*gorm.DB, *schema.Field) string
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Fri Apr 26 07:15:49 GMT 2024 - 29K bytes - Viewed (0) -
logger/logger.go
} } // Trace print sql message // //nolint:cyclop func (l *logger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error) { if l.LogLevel <= Silent { return } elapsed := time.Since(begin) switch { case err != nil && l.LogLevel >= Error && (!errors.Is(err, ErrRecordNotFound) || !l.IgnoreRecordNotFoundError): sql, rows := fc()
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Tue Nov 07 02:19:41 GMT 2023 - 5.8K bytes - Viewed (0) -
callbacks/transaction.go
package callbacks import ( "gorm.io/gorm" ) func BeginTransaction(db *gorm.DB) { if !db.Config.SkipDefaultTransaction && db.Error == nil { if tx := db.Begin(); tx.Error == nil { db.Statement.ConnPool = tx.Statement.ConnPool db.InstanceSet("gorm:started_transaction", true) } else if tx.Error == gorm.ErrInvalidTransaction { tx.Error = nil } else { db.Error = tx.Error } } }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Mon Nov 29 01:33:20 GMT 2021 - 675 bytes - Viewed (0) -
finisher_api.go
if err = fc(tx); err == nil { panicked = false return tx.Commit().Error } } panicked = false return } // Begin begins a transaction with any transaction options opts func (db *DB) Begin(opts ...*sql.TxOptions) *DB { var ( // clone statement tx = db.getInstance().Session(&Session{Context: db.Statement.Context, NewDB: db.clone == 1}) opt *sql.TxOptions err error )
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Fri Jan 12 08:42:21 GMT 2024 - 22.7K bytes - Viewed (0) -
tests/migrate_test.go
return } type Smallint int8 type MigrateInt struct { Int8 Smallint } tracer := Tracer{ Logger: DB.Config.Logger, Test: func(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) { sql, _ := fc() if strings.HasPrefix(sql, "ALTER TABLE \"migrate_ints\" ALTER COLUMN \"int8\" TYPE smallint") {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Mon Mar 18 11:24:16 GMT 2024 - 56.2K bytes - Viewed (0) -
tests/transaction_test.go
package tests_test import ( "context" "errors" "testing" "gorm.io/gorm" . "gorm.io/gorm/utils/tests" ) func TestTransaction(t *testing.T) { tx := DB.Begin() user := *GetUser("transaction", Config{}) if err := tx.Save(&user).Error; err != nil { t.Fatalf("No error should raise, but got %v", err) } if err := tx.First(&User{}, "name = ?", "transaction").Error; err != nil {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Sat Jun 10 13:05:19 GMT 2023 - 10.9K bytes - Viewed (0) -
prepare_stmt.go
db.Mux.Unlock() // prepare completed defer close(cacheStmt.prepared) // Reason why cannot lock conn.PrepareContext // suppose the maxopen is 1, g1 is creating record and g2 is querying record. // 1. g1 begin tx, g1 is requeue because of waiting for the system call, now `db.ConnPool` db.numOpen == 1. // 2. g2 select lock `conn.PrepareContext(ctx, query)`, now db.numOpen == db.maxOpen , wait for release.
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Thu Mar 28 08:47:39 GMT 2024 - 6.4K bytes - Viewed (0) -
callbacks/callbacks.go
} if len(config.UpdateClauses) == 0 { config.UpdateClauses = updateClauses } createCallback := db.Callback().Create() createCallback.Match(enableTransaction).Register("gorm:begin_transaction", BeginTransaction) createCallback.Register("gorm:before_create", BeforeCreate) createCallback.Register("gorm:save_before_associations", SaveBeforeAssociations(true))
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Wed Oct 27 23:56:55 GMT 2021 - 3.3K bytes - Viewed (0) -
tests/preload_test.go
}, }, }, } DB.Create(&users) query := make([]string, 0) sess := DB.Session(&gorm.Session{Logger: Tracer{ Logger: DB.Config.Logger, Test: func(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error) { sql, _ := fc() query = append(query, sql) }, }}) var result []User err := sess. Joins("Manager").
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Thu Apr 25 12:21:03 GMT 2024 - 14.9K bytes - Viewed (0)