Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for hasReturning (0.15 sec)

  1. callbacks/helper.go

    		for i, v := range result[column] {
    			if len(values.Values[i]) == 0 {
    				values.Values[i] = make([]interface{}, len(columns))
    			}
    
    			values.Values[i][idx] = v
    		}
    	}
    	return
    }
    
    func hasReturning(tx *gorm.DB, supportReturning bool) (bool, gorm.ScanMode) {
    	if supportReturning {
    		if c, ok := tx.Statement.Clauses["RETURNING"]; ok {
    			returning, _ := c.Expression.(clause.Returning)
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Apr 14 12:32:57 UTC 2022
    - 3.7K bytes
    - Viewed (0)
  2. callbacks/delete.go

    			db.Statement.AddClauseIfNotExists(clause.From{})
    
    			db.Statement.Build(db.Statement.BuildClauses...)
    		}
    
    		checkMissingWhereConditions(db)
    
    		if !db.DryRun && db.Error == nil {
    			ok, mode := hasReturning(db, supportReturning)
    			if !ok {
    				result, err := db.Statement.ConnPool.ExecContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...)
    				if db.AddError(err) == nil {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Fri Feb 25 02:48:23 UTC 2022
    - 5.6K bytes
    - Viewed (0)
  3. callbacks/update.go

    				} else {
    					return
    				}
    			}
    
    			db.Statement.Build(db.Statement.BuildClauses...)
    		}
    
    		checkMissingWhereConditions(db)
    
    		if !db.DryRun && db.Error == nil {
    			if ok, mode := hasReturning(db, supportReturning); ok {
    				if rows, err := db.Statement.ConnPool.QueryContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...); db.AddError(err) == nil {
    					dest := db.Statement.Dest
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Mar 18 05:44:55 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  4. callbacks/create.go

    			db.Statement.Build(db.Statement.BuildClauses...)
    		}
    
    		isDryRun := !db.DryRun && db.Error == nil
    		if !isDryRun {
    			return
    		}
    
    		ok, mode := hasReturning(db, supportReturning)
    		if ok {
    			if c, ok := db.Statement.Clauses["ON CONFLICT"]; ok {
    				if onConflict, _ := c.Expression.(clause.OnConflict); onConflict.DoNothing {
    					mode |= gorm.ScanOnConflictDoNothing
    				}
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Apr 08 03:29:55 UTC 2024
    - 12.5K bytes
    - Viewed (0)
Back to top