Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for statement (0.19 sec)

  1. migrator/migrator.go

    	GormDBDataType(*gorm.DB, *schema.Field) string
    }
    
    // RunWithValue run migration with statement value
    func (m Migrator) RunWithValue(value interface{}, fc func(*gorm.Statement) error) error {
    	stmt := &gorm.Statement{DB: m.DB}
    	if m.DB.Statement != nil {
    		stmt.Table = m.DB.Statement.Table
    		stmt.TableExpr = m.DB.Statement.TableExpr
    	}
    
    	if table, ok := value.(string); ok {
    		stmt.Table = table
    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. migrator.go

    import (
    	"reflect"
    
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/schema"
    )
    
    // Migrator returns migrator
    func (db *DB) Migrator() Migrator {
    	tx := db.getInstance()
    
    	// apply scopes to migrator
    	for len(tx.Statement.scopes) > 0 {
    		tx = tx.executeScopes()
    	}
    
    	return tx.Dialector.Migrator(tx.Session(&Session{}))
    }
    
    // AutoMigrate run auto migration for given models
    func (db *DB) AutoMigrate(dst ...interface{}) error {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 3.1K bytes
    - Viewed (0)
Back to top