Search Options

Results per page
Sort
Preferred Languages
Advance

Results 61 - 70 of 947 for gorm (0.01 sec)

  1. logger/slog_test.go

    		return "select count(*) from users", 0
    	}, nil)
    
    	if strings.Contains(buf.String(), "gorm/logger/slog.go") {
    		t.Error("Found internal slog.go reference in caller frame. Expected only test file references.")
    	}
    
    	if !strings.Contains(buf.String(), "gorm/logger/slog_test.go") {
    		t.Error("Missing expected test file reference. 'gorm/logger/slog_test.go' should appear in caller frames.")
    	}
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Thu Oct 30 10:56:26 UTC 2025
    - 782 bytes
    - Viewed (0)
  2. tests/preload_suits_test.go

    	}
    
    	type (
    		Level1 struct {
    			ID           uint   `gorm:"primary_key;"`
    			LanguageCode string `gorm:"primary_key"`
    			Value        string
    		}
    		Level2 struct {
    			ID           uint   `gorm:"primary_key;"`
    			LanguageCode string `gorm:"primary_key"`
    			Value        string
    			Level1s      []Level1 `gorm:"many2many:levels;"`
    		}
    	)
    
    	DB.Migrator().DropTable(&Level2{}, &Level1{})
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Thu Jun 05 11:34:13 UTC 2025
    - 30.4K bytes
    - Viewed (0)
  3. callbacks/callbacks.go

    package callbacks
    
    import (
    	"gorm.io/gorm"
    )
    
    var (
    	createClauses = []string{"INSERT", "VALUES", "ON CONFLICT"}
    	queryClauses  = []string{"SELECT", "FROM", "WHERE", "GROUP BY", "ORDER BY", "LIMIT", "FOR"}
    	updateClauses = []string{"UPDATE", "SET", "WHERE"}
    	deleteClauses = []string{"DELETE", "FROM", "WHERE"}
    )
    
    type Config struct {
    	LastInsertIDReversed bool
    	CreateClauses        []string
    	QueryClauses         []string
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Wed Oct 27 23:56:55 UTC 2021
    - 3.3K bytes
    - Viewed (0)
  4. tests/query_test.go

    	type QueryResetItem struct {
    		ID   string `gorm:"type:varchar(5)"`
    		Name string
    	}
    
    	type QueryResetNullValue struct {
    		ID      int
    		Name    string     `gorm:"default:NULL"`
    		Flag    bool       `gorm:"default:NULL"`
    		Number1 int64      `gorm:"default:NULL"`
    		Number2 uint64     `gorm:"default:NULL"`
    		Number3 float64    `gorm:"default:NULL"`
    		Now     *time.Time `gorm:"default:NULL"`
    		Item1Id string
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Tue Jul 22 06:21:04 UTC 2025
    - 51K bytes
    - Viewed (0)
  5. .github/workflows/tests.yml

        services:
          mysql:
            image: ${{ matrix.dbversion }}
            env:
              MYSQL_DATABASE: gorm
              MYSQL_USER: gorm
              MYSQL_PASSWORD: gorm
              MYSQL_RANDOM_ROOT_PASSWORD: "yes"
            ports:
              - 9910:3306
            options: >-
              --health-cmd "mysqladmin ping -ugorm -pgorm"
              --health-interval 10s
              --health-start-period 10s
              --health-timeout 5s
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Mon Sep 08 09:19:22 UTC 2025
    - 8.9K bytes
    - Viewed (0)
  6. tests/scopes_test.go

    import (
    	"context"
    	"testing"
    
    	"gorm.io/gorm"
    	. "gorm.io/gorm/utils/tests"
    )
    
    func NameIn1And2(d *gorm.DB) *gorm.DB {
    	return d.Where("name in (?)", []string{"ScopeUser1", "ScopeUser2"})
    }
    
    func NameIn2And3(d *gorm.DB) *gorm.DB {
    	return d.Where("name in (?)", []string{"ScopeUser2", "ScopeUser3"})
    }
    
    func NameIn(names []string) func(d *gorm.DB) *gorm.DB {
    	return func(d *gorm.DB) *gorm.DB {
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Fri Jan 12 08:42:21 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  7. tests/submodel_test.go

    package tests_test
    
    import (
    	"testing"
    
    	"gorm.io/gorm"
    )
    
    type Man struct {
    	ID     int
    	Age    int
    	Name   string
    	Detail string
    }
    
    // Panic-safe BeforeUpdate hook that checks for Changed("age")
    func (m *Man) BeforeUpdate(tx *gorm.DB) (err error) {
    	if !tx.Statement.Changed("age") {
    		return nil
    	}
    	return nil
    }
    
    func TestSubModel(t *testing.T) {
    	man := Man{Age: 18, Name: "random-name"}
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Mon Sep 08 09:19:22 UTC 2025
    - 947 bytes
    - Viewed (0)
  8. schema/utils.go

    package schema
    
    import (
    	"context"
    	"fmt"
    	"reflect"
    	"regexp"
    	"strings"
    
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/utils"
    )
    
    var embeddedCacheKey = "embedded_cache_store"
    
    func ParseTagSetting(str string, sep string) map[string]string {
    	settings := map[string]string{}
    	names := strings.Split(str, sep)
    
    	var parsedNames []string
    	for i := 0; i < len(names); i++ {
    		s := names[i]
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Thu Oct 30 11:15:36 UTC 2025
    - 5.9K bytes
    - Viewed (0)
  9. schema/relationship_test.go

    package schema_test
    
    import (
    	"sync"
    	"testing"
    	"time"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils/tests"
    )
    
    func checkStructRelation(t *testing.T, data interface{}, relations ...Relation) {
    	if s, err := schema.Parse(data, &sync.Map{}, schema.NamingStrategy{}); err != nil {
    		t.Errorf("Failed to parse schema, got error %v", err)
    	} else {
    		for _, rel := range relations {
    			checkSchemaRelation(t, s, rel)
    		}
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Mon Aug 18 11:44:52 UTC 2025
    - 26.5K bytes
    - Viewed (0)
  10. statement_test.go

    package gorm
    
    import (
    	"fmt"
    	"reflect"
    	"testing"
    
    	"gorm.io/gorm/clause"
    )
    
    func TestWhereCloneCorruption(t *testing.T) {
    	for whereCount := 1; whereCount <= 8; whereCount++ {
    		t.Run(fmt.Sprintf("w=%d", whereCount), func(t *testing.T) {
    			s := new(Statement)
    			for w := 0; w < whereCount; w++ {
    				s = s.clone()
    				s.AddClause(clause.Where{
    					Exprs: s.BuildCondition(fmt.Sprintf("where%d", w)),
    				})
    			}
    
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Sat Dec 23 13:19:41 UTC 2023
    - 1.9K bytes
    - Viewed (0)
Back to top