Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 52 for Pschera (0.19 sec)

  1. schema/index_test.go

    			Option:  "WITH PARSER parser_name",
    			Fields: []schema.IndexOption{{Field: &schema.Field{Name: "Name6"}}, {
    				Field:      &schema.Field{Name: "Age"},
    				Expression: "ABS(age)",
    			}},
    		},
    		"idx_id": {
    			Name:   "idx_id",
    			Fields: []schema.IndexOption{{Field: &schema.Field{Name: "MemberNumber"}}, {Field: &schema.Field{Name: "OID", UniqueIndex: "idx_oid"}}},
    		},
    		"idx_oid": {
    			Name:   "idx_oid",
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 8K bytes
    - Viewed (0)
  2. schema/index.go

    	Length     int
    	priority   int
    }
    
    // ParseIndexes parse schema indexes
    func (schema *Schema) ParseIndexes() map[string]Index {
    	indexes := map[string]Index{}
    
    	for _, field := range schema.Fields {
    		if field.TagSettings["INDEX"] != "" || field.TagSettings["UNIQUEINDEX"] != "" {
    			fieldIndexes, err := parseFieldIndexes(field)
    			if err != nil {
    				schema.err = err
    				break
    			}
    			for _, index := range fieldIndexes {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  3. schema/callbacks_test.go

    package schema_test
    
    import (
    	"reflect"
    	"sync"
    	"testing"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/schema"
    )
    
    type UserWithCallback struct{}
    
    func (UserWithCallback) BeforeSave(*gorm.DB) error {
    	return nil
    }
    
    func (UserWithCallback) AfterCreate(*gorm.DB) error {
    	return nil
    }
    
    func TestCallback(t *testing.T) {
    	user, err := schema.Parse(&UserWithCallback{}, &sync.Map{}, schema.NamingStrategy{})
    	if err != nil {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 939 bytes
    - Viewed (0)
  4. 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)
    
    	for i := 0; i < len(names); i++ {
    		j := i
    		if len(names[j]) > 0 {
    			for {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Aug 19 13:35:14 GMT 2023
    - 5.5K bytes
    - Viewed (0)
  5. tests/update_test.go

    	}
    }
    
    func TestUpdateWithDiffSchema(t *testing.T) {
    	user := GetUser("update-diff-schema-1", Config{})
    	DB.Create(&user)
    
    	type UserTemp struct {
    		Name string
    	}
    
    	err := DB.Model(&user).Updates(&UserTemp{Name: "update-diff-schema-2"}).Error
    	AssertEqual(t, err, nil)
    	AssertEqual(t, "update-diff-schema-2", user.Name)
    }
    
    type TokenOwner struct {
    	ID    int
    	Name  string
    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)
  6. schema/schema_helper_test.go

    			if r.Name != relation.Name {
    				t.Errorf("schema %v relation name expects %v, but got %v", s, r.Name, relation.Name)
    			}
    
    			if r.Type != relation.Type {
    				t.Errorf("schema %v relation name expects %v, but got %v", s, r.Type, relation.Type)
    			}
    
    			if r.Schema.Name != relation.Schema {
    				t.Errorf("schema %v relation's schema expects %v, but got %v", s, relation.Schema, r.Schema.Name)
    			}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  7. migrator/migrator.go

    			for _, rel := range dep.Schema.Relationships.Relations {
    				if rel.Field.IgnoreMigration {
    					continue
    				}
    				if c := rel.ParseConstraint(); c != nil && c.Schema == dep.Statement.Schema && c.Schema != c.ReferenceSchema {
    					dep.Depends = append(dep.Depends, c.ReferenceSchema)
    				}
    
    				if rel.Type == schema.HasOne || rel.Type == schema.HasMany {
    					beDependedOn[rel.FieldSchema] = true
    				}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  8. callbacks/query.go

    				case reflect.Slice:
    					queryFields = db.Statement.ReflectValue.Type().Elem() != db.Statement.Schema.ModelType
    				}
    			}
    
    			if queryFields {
    				stmt := gorm.Statement{DB: db}
    				// smaller struct
    				if err := stmt.Parse(db.Statement.Dest); err == nil && (db.QueryFields || stmt.Schema.ModelType != db.Statement.Schema.ModelType) {
    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)
  9. soft_delete.go

    		stmt.SetColumn(sd.Field.DBName, curTime, true)
    
    		if stmt.Schema != nil {
    			_, queryValues := schema.GetIdentityFieldValuesMap(stmt.Context, stmt.ReflectValue, stmt.Schema.PrimaryFields)
    			column, values := schema.ToQueryValues(stmt.Table, stmt.Schema.PrimaryFieldDBNames, queryValues)
    
    			if len(values) > 0 {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Feb 01 06:40:55 GMT 2023
    - 4.5K bytes
    - Viewed (0)
  10. callbacks/create_test.go

    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/schema"
    )
    
    var schemaCache = &sync.Map{}
    
    func TestConvertToCreateValues_DestType_Slice(t *testing.T) {
    	type user struct {
    		ID    int `gorm:"primaryKey"`
    		Name  string
    		Email string `gorm:"default:(-)"`
    		Age   int    `gorm:"default:(-)"`
    	}
    
    	s, err := schema.Parse(&user{}, schemaCache, schema.NamingStrategy{})
    	if err != nil {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 05:48:42 GMT 2024
    - 1.4K bytes
    - Viewed (0)
Back to top