Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 23 for qrerun (1.03 sec)

  1. tests/scanner_valuer_test.go

    	}
    }
    
    func TestGORMValuer(t *testing.T) {
    	type UserWithPoint struct {
    		Name  string
    		Point Point
    	}
    
    	dryRunDB := DB.Session(&gorm.Session{DryRun: true})
    
    	stmt := dryRunDB.Create(&UserWithPoint{
    		Name:  "jinzhu",
    		Point: Point{X: 100, Y: 100},
    	}).Statement
    
    	if stmt.SQL.String() == "" || len(stmt.Vars) != 2 {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
  2. tests/update_test.go

    	}
    
    	dryDB := DB.Session(&gorm.Session{DryRun: true})
    	stmt := dryDB.Save(&user).Statement
    	if !regexp.MustCompile(`.users.\..deleted_at. IS NULL`).MatchString(stmt.SQL.String()) {
    		t.Fatalf("invalid updating SQL, got %v", stmt.SQL.String())
    	}
    
    	dryDB = DB.Session(&gorm.Session{DryRun: true})
    	stmt = dryDB.Unscoped().Save(&user).Statement
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  3. tests/distinct_test.go

    		t.Errorf("failed to query users count, got error: %v, count %v", err, count)
    	}
    
    	dryDB := DB.Session(&gorm.Session{DryRun: true})
    	r := dryDB.Distinct("u.id, u.*").Table("user_speaks as s").Joins("inner join users as u on u.id = s.user_id").Where("s.language_code ='US' or s.language_code ='ES'").Find(&User{})
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 2.5K bytes
    - Viewed (0)
  4. tests/upsert_test.go

    	if name := DB.Dialector.Name(); name != "sqlserver" {
    		type RestrictedLanguage struct {
    			Code string `gorm:"primarykey"`
    			Name string
    			Lang string `gorm:"<-:create"`
    		}
    
    		r := DB.Session(&gorm.Session{DryRun: true}).Clauses(clause.OnConflict{UpdateAll: true}).Create(&RestrictedLanguage{Code: "upsert_code", Name: "upsert_name", Lang: "upsert_lang"})
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Sep 05 07:39:19 GMT 2022
    - 11.4K bytes
    - Viewed (0)
  5. callbacks/query.go

    	"fmt"
    	"reflect"
    	"strings"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils"
    )
    
    func Query(db *gorm.DB) {
    	if db.Error == nil {
    		BuildQuerySQL(db)
    
    		if !db.DryRun && db.Error == nil {
    			rows, err := db.Statement.ConnPool.QueryContext(db.Statement.Context, db.Statement.SQL.String(), db.Statement.Vars...)
    			if err != nil {
    				db.AddError(err)
    				return
    			}
    			defer func() {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Jan 29 03:34:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  6. migrator/migrator.go

    		}
    	}
    
    	return
    }
    
    func (m Migrator) GetQueryAndExecTx() (queryTx, execTx *gorm.DB) {
    	queryTx = m.DB.Session(&gorm.Session{})
    	execTx = queryTx
    	if m.DB.DryRun {
    		queryTx.DryRun = false
    		execTx = m.DB.Session(&gorm.Session{Logger: &printSQLLogger{Interface: m.DB.Logger}})
    	}
    	return queryTx, execTx
    }
    
    // AutoMigrate auto migrate values
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  7. README.md

    * Hooks (Before/After Create/Save/Update/Delete/Find)
    * Eager loading with `Preload`, `Joins`
    * Transactions, Nested Transactions, Save Point, RollbackTo to Saved Point
    * Context, Prepared Statement Mode, DryRun Mode
    * Batch Insert, FindInBatches, Find To Map
    * SQL Builder, Upsert, Locking, Optimizer/Index/Comment Hints, NamedArg, Search/Update/Create with SQL Expr
    * Composite Primary Key
    * Auto Migrations
    * Logger
    Plain Text
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Nov 07 02:20:06 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  8. callbacks/update.go

    					db.Statement.AddClause(set)
    				} 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 {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 05:44:55 GMT 2024
    - 9.4K bytes
    - Viewed (1)
  9. statement.go

    				writer.WriteByte('(')
    				stmt.AddVar(writer, v...)
    				writer.WriteByte(')')
    			} else {
    				writer.WriteString("(NULL)")
    			}
    		case *DB:
    			subdb := v.Session(&Session{Logger: logger.Discard, DryRun: true}).getInstance()
    			if v.Statement.SQL.Len() > 0 {
    				var (
    					vars = subdb.Statement.Vars
    					sql  = v.Statement.SQL.String()
    				)
    
    				subdb.Statement.Vars = make([]interface{}, 0, len(vars))
    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)
  10. 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...)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Feb 25 02:48:23 GMT 2022
    - 5.6K bytes
    - Viewed (0)
Back to top