Search Options

Results per page
Sort
Preferred Languages
Advance

Results 311 - 320 of 637 for Schema_ (0.12 sec)

  1. schema/constraint.go

    }
    
    // ParseUniqueConstraints parse schema unique constraints
    func (schema *Schema) ParseUniqueConstraints() map[string]UniqueConstraint {
    	uniques := make(map[string]UniqueConstraint)
    	for _, field := range schema.Fields {
    		if field.Unique {
    			name := schema.namer.UniqueName(schema.Table, field.DBName)
    			uniques[name] = UniqueConstraint{Name: name, Field: field}
    		}
    	}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Mar 18 07:33:54 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  2. callbacks/delete.go

    			return
    		}
    
    		if db.Statement.Schema != nil {
    			for _, c := range db.Statement.Schema.DeleteClauses {
    				db.Statement.AddClause(c)
    			}
    		}
    
    		if db.Statement.SQL.Len() == 0 {
    			db.Statement.SQL.Grow(100)
    			db.Statement.AddClauseIfNotExists(clause.Delete{})
    
    			if db.Statement.Schema != nil {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Fri Feb 25 02:48:23 UTC 2022
    - 5.6K bytes
    - Viewed (0)
  3. schema/schema_test.go

    	}
    
    	checkUserSchema(t, user)
    }
    
    func checkUserSchema(t *testing.T, user *schema.Schema) {
    	// check schema
    	checkSchema(t, user, schema.Schema{Name: "User", Table: "users"}, []string{"ID"})
    
    	// check fields
    	fields := []schema.Field{
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Jun 20 12:19:31 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  4. 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",
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Sun Feb 04 07:49:19 UTC 2024
    - 8K bytes
    - Viewed (0)
  5. 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) {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Aug 22 11:03:42 UTC 2024
    - 10.1K bytes
    - Viewed (0)
  6. callbacks/update.go

    					for _, field := range stmt.Schema.PrimaryFields {
    						_, isZero = field.ValueOf(stmt.Context, stmt.ReflectValue.Index(i))
    						if !isZero {
    							break
    						}
    					}
    				}
    
    				if !isZero {
    					_, primaryValues := schema.GetIdentityFieldValuesMap(stmt.Context, stmt.ReflectValue, stmt.Schema.PrimaryFields)
    					column, values := schema.ToQueryValues("", stmt.Schema.PrimaryFieldDBNames, primaryValues)
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Mar 18 05:44:55 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  7. docs/en/mkdocs.yml

        - how-to/index.md
        - how-to/general.md
        - how-to/graphql.md
        - how-to/custom-request-and-route.md
        - how-to/conditional-openapi.md
        - how-to/extending-openapi.md
        - how-to/separate-openapi-schemas.md
        - how-to/custom-docs-ui-assets.md
        - how-to/configure-swagger-ui.md
        - how-to/testing-database.md
    - Reference (Code API):
      - reference/index.md
      - reference/fastapi.md
      - reference/parameters.md
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Tue Oct 22 20:28:02 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  8. schema/constraint_test.go

    		Name2 string `gorm:"uniqueIndex"`
    	}
    
    	user, err := schema.Parse(&UserUnique{}, &sync.Map{}, schema.NamingStrategy{})
    	if err != nil {
    		t.Fatalf("failed to parse user unique, got error %v", err)
    	}
    	constraints := user.ParseUniqueConstraints()
    
    	results := map[string]schema.UniqueConstraint{
    		"uni_user_uniques_name1": {
    			Name:  "uni_user_uniques_name1",
    			Field: &schema.Field{Name: "Name1", Unique: true},
    		},
    	}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Sun Feb 04 07:49:19 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  9. callbacks/preload.go

    package callbacks
    
    import (
    	"fmt"
    	"reflect"
    	"sort"
    	"strings"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils"
    )
    
    // parsePreloadMap extracts nested preloads. e.g.
    //
    //	// schema has a "k0" relation and a "k7.k8" embedded relation
    //	parsePreloadMap(schema, map[string][]interface{}{
    //		clause.Associations: {"arg1"},
    //		"k1":                {"arg2"},
    //		"k2.k3":             {"arg3"},
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 10:52:33 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  10. 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 {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Sun Feb 04 07:49:19 UTC 2024
    - 3.7K bytes
    - Viewed (0)
Back to top