Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for table (0.94 sec)

  1. migrator/migrator.go

    		currentDatabase := m.DB.Migrator().CurrentDatabase()
    		return m.DB.Raw("SELECT count(*) FROM information_schema.tables WHERE table_schema = ? AND table_name = ? AND table_type = ?", currentDatabase, stmt.Table, "BASE TABLE").Row().Scan(&count)
    	})
    
    	return count > 0
    }
    
    // RenameTable rename table from oldName to newName
    func (m Migrator) RenameTable(oldName, newName interface{}) error {
    	var oldTable, newTable interface{}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  2. callbacks/preload.go

    						return err
    					}
    				default:
    					return gorm.ErrInvalidData
    				}
    			} else {
    				tx := db.Table("").Session(&gorm.Session{Context: db.Statement.Context, SkipHooks: db.Statement.SkipHooks})
    				tx.Statement.ReflectValue = db.Statement.ReflectValue
    				tx.Statement.Unscoped = db.Statement.Unscoped
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  3. tests/preload_test.go

    		}
    	}
    
    	CheckUser(t, users2[0], users[0])
    
    	var users3 []User
    	if err := DB.Preload("Account", func(tx *gorm.DB) *gorm.DB {
    		return tx.Table("accounts AS a").Select("a.*")
    	}).Find(&users3, "id IN ?", userIDs).Error; err != nil {
    		t.Errorf("failed to query, got error %v", err)
    	}
    	sort.Slice(users3, func(i, j int) bool {
    		return users2[i].ID < users2[j].ID
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  4. tests/query_test.go

    		*GetUser("find_in_batches_with_error", Config{}),
    	}
    
    	DB.Create(&users)
    
    	var (
    		results    []User
    		totalBatch int
    	)
    
    	if result := DB.Table("wrong_table").Where("name = ?", users[0].Name).FindInBatches(&results, 2, func(tx *gorm.DB, batch int) error {
    		totalBatch += batch
    		return nil
    	}); result.Error == nil || result.RowsAffected > 0 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
Back to top