Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for kwargs (0.18 sec)

  1. tests/migrate_test.go

    	_, err = findColumnType(&RelationModel2{}, "id")
    	if err == nil {
    		t.Errorf("RelationModel2 should not be migrated")
    	}
    }
    
    func TestMigrateView(t *testing.T) {
    	DB.Save(GetUser("joins-args-db", Config{Pets: 2}))
    
    	if err := DB.Migrator().CreateView("invalid_users_pets",
    		gorm.ViewOption{Query: nil}); err != gorm.ErrSubQueryRequired {
    		t.Fatalf("no view should be created, got %v", err)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  2. prepare_stmt.go

    	}
    	return nil, ErrInvalidTransaction
    }
    
    func (db *PreparedStmtDB) ExecContext(ctx context.Context, query string, args ...interface{}) (result sql.Result, err error) {
    	stmt, err := db.prepare(ctx, db.ConnPool, false, query)
    	if err == nil {
    		result, err = stmt.ExecContext(ctx, args...)
    		if errors.Is(err, driver.ErrBadConn) {
    			db.Mux.Lock()
    			defer db.Mux.Unlock()
    			go stmt.Close()
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 28 08:47:39 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  3. statement.go

    			}
    
    			if len(args) > 0 && strings.Contains(s, "@") {
    				// looks like a named query
    				return []clause.Expression{clause.NamedExpr{SQL: s, Vars: args}}
    			}
    
    			if strings.Contains(strings.TrimSpace(s), " ") {
    				// looks like a where condition
    				return []clause.Expression{clause.Expr{SQL: s, Vars: args}}
    			}
    
    			if len(args) == 1 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  4. interfaces.go

    type ConnPool interface {
    	PrepareContext(ctx context.Context, query string) (*sql.Stmt, error)
    	ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
    	QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
    	QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
    }
    
    // SavePointerDialectorInterface save pointer interface
    type SavePointerDialectorInterface interface {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Aug 19 13:33:31 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  5. callbacks/preload.go

    	preloadMap := map[string]map[string][]interface{}{}
    	setPreloadMap := func(name, value string, args []interface{}) {
    		if _, ok := preloadMap[name]; !ok {
    			preloadMap[name] = map[string][]interface{}{}
    		}
    		if value != "" {
    			preloadMap[name][value] = args
    		}
    	}
    
    	for name, args := range preloads {
    		preloadFields := strings.Split(name, ".")
    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)
  6. tests/preload_test.go

    		},
    	}
    
    	for _, test := range tests {
    		t.Run(test.name, func(t *testing.T) {
    			actual := Org{}
    			tx := DB.Where("id = ?", org.ID).Session(&gorm.Session{})
    			for name, args := range test.preloads {
    				tx = tx.Preload(name, args...)
    			}
    			if err := tx.Find(&actual).Error; err != nil {
    				t.Errorf("failed to find org, got err: %v", err)
    			}
    			AssertEqual(t, actual, test.expect)
    		})
    	}
    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)
Back to top