- Sort Score
- Result 10 results
- Languages All
Results 1 - 9 of 9 for scwang (0.16 sec)
-
scan.go
field.NewValuePool.Put(values[idx]) } } // ScanMode scan data mode type ScanMode uint8 // scan modes const ( ScanInitialized ScanMode = 1 << 0 // 1 ScanUpdate ScanMode = 1 << 1 // 2 ScanOnConflictDoNothing ScanMode = 1 << 2 // 4 ) // Scan scan rows into db statement func Scan(rows Rows, db *DB, mode ScanMode) { var ( columns, _ = rows.Columns()
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Apr 26 09:53:11 GMT 2024 - 9.8K bytes - Viewed (0) -
migrator/migrator.go
} // GetTables returns tables func (m Migrator) GetTables() (tableList []string, err error) { err = m.DB.Raw("SELECT TABLE_NAME FROM information_schema.tables where TABLE_SCHEMA=?", m.CurrentDatabase()). Scan(&tableList).Error return } // CreateTable create table in database for values func (m Migrator) CreateTable(values ...interface{}) error { for _, value := range m.ReorderModels(values, false) {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Apr 26 07:15:49 GMT 2024 - 29K bytes - Viewed (0) -
callbacks/query.go
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Jan 29 03:34:57 GMT 2024 - 9.9K bytes - Viewed (0) -
finisher_api.go
rows, ok := tx.Statement.Dest.(*sql.Rows) if !ok && tx.DryRun && tx.Error == nil { tx.Error = ErrDryRunModeUnsupported } return rows, tx.Error } // Scan scans selected value to the struct dest func (db *DB) Scan(dest interface{}) (tx *DB) { config := *db.Config currentLogger, newLogger := config.Logger, logger.Recorder.New() config.Logger = newLogger tx = db.getInstance()
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Jan 12 08:42:21 GMT 2024 - 22.7K bytes - Viewed (0) -
callbacks/create.go
db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars..., ) if db.AddError(err) == nil { defer func() { db.AddError(rows.Close()) }() gorm.Scan(rows, db, mode) } return } result, err := db.Statement.ConnPool.ExecContext( db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars..., ) if err != nil { db.AddError(err)
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Apr 08 03:29:55 GMT 2024 - 12.5K bytes - Viewed (0) -
tests/scanner_valuer_test.go
// prepend asterisks return append([]byte("***"), data...), nil } type Num int64 func (i *Num) Scan(src interface{}) error { switch s := src.(type) { case []byte: n, _ := strconv.Atoi(string(s)) *i = Num(n) case int64: *i = Num(s) default: return errors.New("Cannot scan NamedInt from " + reflect.ValueOf(src).String()) } return nil } type StringsSlice []string
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Wed Jun 07 07:02:07 GMT 2023 - 10.6K bytes - Viewed (0) -
tests/transaction_test.go
DB.Create(&user) var err error err = DB.Transaction(func(tx *gorm.DB) error { return tx.Model(&User{}).Limit(1).Transaction(func(tx2 *gorm.DB) error { return tx2.Scan(&User{}).Error }) }) if err != nil { t.Error(err) } // method with hooks err = DB.Transaction(func(tx1 *gorm.DB) error { // callMethod do
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Sat Jun 10 13:05:19 GMT 2023 - 10.9K bytes - Viewed (0) -
tests/sql_builder_test.go
DB.Save(&user1).Save(&user2).Save(&user3) row := DB.Table("users").Where("name = ?", user2.Name).Select("age").Row() var age int64 if err := row.Scan(&age); err != nil { t.Fatalf("Failed to scan age, got %v", err) } if age != 10 { t.Errorf("Scan with Row, age expects: %v, got %v", user2.Age, age) } table := "gorm.users" if DB.Dialector.Name() != "mysql" || isTiDB() {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Jan 12 08:42:21 GMT 2024 - 16.7K bytes - Viewed (0) -
schema/field.go
fieldValue.Set(reflect.New(field.FieldType.Elem())) } if valuer, ok := v.(driver.Valuer); ok { v, _ = valuer.Value() } err = fieldValue.Interface().(sql.Scanner).Scan(v) } return } } else if _, ok := fieldValue.Interface().(sql.Scanner); ok { // struct scanner field.Set = func(ctx context.Context, value reflect.Value, v interface{}) (err error) {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Apr 15 03:20:20 GMT 2024 - 32K bytes - Viewed (1)