Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for executeScopes (0.19 sec)

  1. migrator.go

    	"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 {
    	return db.Migrator().AutoMigrate(dst...)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  2. callbacks.go

    }
    
    func (cs *callbacks) Raw() *processor {
    	return cs.processors["raw"]
    }
    
    func (p *processor) Execute(db *DB) *DB {
    	// call scopes
    	for len(db.Statement.scopes) > 0 {
    		db = db.executeScopes()
    	}
    
    	var (
    		curTime           = time.Now()
    		stmt              = db.Statement
    		resetBuildClauses bool
    	)
    
    	if len(stmt.BuildClauses) == 0 {
    		stmt.BuildClauses = p.Clauses
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 8.6K bytes
    - Viewed (1)
  3. chainable_api.go

    func (db *DB) Scopes(funcs ...func(*DB) *DB) (tx *DB) {
    	tx = db.getInstance()
    	tx.Statement.scopes = append(tx.Statement.scopes, funcs...)
    	return tx
    }
    
    func (db *DB) executeScopes() (tx *DB) {
    	scopes := db.Statement.scopes
    	db.Statement.scopes = nil
    	for _, scope := range scopes {
    		db = scope(db)
    	}
    	return db
    }
    
    // Preload preload associations with given conditions
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  4. statement.go

    			continue
    		}
    		if valuer, ok := arg.(driver.Valuer); ok {
    			arg, _ = valuer.Value()
    		}
    
    		switch v := arg.(type) {
    		case clause.Expression:
    			conds = append(conds, v)
    		case *DB:
    			v.executeScopes()
    
    			if cs, ok := v.Statement.Clauses["WHERE"]; ok {
    				if where, ok := cs.Expression.(clause.Where); ok {
    					if len(where.Exprs) == 1 {
    						if orConds, ok := where.Exprs[0].(clause.OrConditions); ok {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
Back to top