Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 80 for constraint (0.22 sec)

  1. schema/constraint.go

    	Name       string
    	Constraint string // length(phone) >= 10
    	*Field
    }
    
    func (chk *CheckConstraint) GetName() string { return chk.Name }
    
    func (chk *CheckConstraint) Build() (sql string, vars []interface{}) {
    	return "CONSTRAINT ? CHECK (?)", []interface{}{clause.Column{Name: chk.Name}, clause.Expr{SQL: chk.Constraint}}
    }
    
    // ParseCheckConstraints parse schema check constraints
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 07:33:54 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  2. schema/constraint_test.go

    	results := map[string]schema.CheckConstraint{
    		"name_checker": {
    			Name:       "name_checker",
    			Constraint: "name <> 'jinzhu'",
    		},
    		"chk_user_checks_name2": {
    			Name:       "chk_user_checks_name2",
    			Constraint: "name <> 'jinzhu'",
    		},
    		"chk_user_checks_name3": {
    			Name:       "chk_user_checks_name3",
    			Constraint: "name <> 'jinzhu'",
    		},
    	}
    
    	checks := user.ParseCheckConstraints()
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 2.2K bytes
    - Viewed (0)
  3. migrator/migrator.go

    		currentDatabase := m.DB.Migrator().CurrentDatabase()
    		constraint, table := m.GuessConstraintInterfaceAndTable(stmt, name)
    		if constraint != nil {
    			name = constraint.GetName()
    		}
    
    		return m.DB.Raw(
    			"SELECT count(*) FROM INFORMATION_SCHEMA.table_constraints WHERE constraint_schema = ? AND table_name = ? AND constraint_name = ?",
    			currentDatabase, table, name,
    		).Row().Scan(&count)
    	})
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  4. schema/relationship.go

    	sql = "CONSTRAINT ? FOREIGN KEY ? REFERENCES ??"
    	if constraint.OnDelete != "" {
    		sql += " ON DELETE " + constraint.OnDelete
    	}
    
    	if constraint.OnUpdate != "" {
    		sql += " ON UPDATE " + constraint.OnUpdate
    	}
    
    	foreignKeys := make([]interface{}, 0, len(constraint.ForeignKeys))
    	for _, field := range constraint.ForeignKeys {
    		foreignKeys = append(foreignKeys, clause.Column{Name: field.DBName})
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
  5. clause/on_conflict.go

    	Where        Where
    	TargetWhere  Where
    	OnConstraint string
    	DoNothing    bool
    	DoUpdates    Set
    	UpdateAll    bool
    }
    
    func (OnConflict) Name() string {
    	return "ON CONFLICT"
    }
    
    // Build build onConflict clause
    func (onConflict OnConflict) Build(builder Builder) {
    	if onConflict.OnConstraint != "" {
    		builder.WriteString("ON CONSTRAINT ")
    		builder.WriteString(onConflict.OnConstraint)
    		builder.WriteByte(' ')
    	} else {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Oct 07 05:46:20 GMT 2022
    - 1.3K bytes
    - Viewed (0)
  6. src/cmd/asm/internal/lex/tokenizer.go

    // Copyright 2015 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package lex
    
    import (
    	"go/build/constraint"
    	"io"
    	"os"
    	"strings"
    	"text/scanner"
    	"unicode"
    
    	"cmd/asm/internal/flags"
    	"cmd/internal/objabi"
    	"cmd/internal/src"
    )
    
    // A Tokenizer is a simple wrapping of text/scanner.Scanner, configured
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Aug 04 20:35:21 GMT 2022
    - 3K bytes
    - Viewed (0)
  7. tests/associations_test.go

    		Name    string
    		Profile Profile `gorm:"Constraint:OnUpdate:CASCADE,OnDelete:CASCADE;FOREIGNKEY:MemberID;References:Refer"`
    	}
    
    	DB.Migrator().DropTable(&Profile{}, &Member{})
    
    	if err := DB.AutoMigrate(&Profile{}, &Member{}); err != nil {
    		t.Fatalf("Failed to migrate, got error: %v", err)
    	}
    
    	member := Member{Refer: 1, Name: "foreign_key_constraints", Profile: Profile{Name: "my_profile"}}
    
    	DB.Create(&member)
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Feb 08 08:29:09 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  8. errors.go

    	// ErrDuplicatedKey occurs when there is a unique key constraint violation
    	ErrDuplicatedKey = errors.New("duplicated key not allowed")
    	// ErrForeignKeyViolated occurs when there is a foreign key constraint violation
    	ErrForeignKeyViolated = errors.New("violates foreign key constraint")
    	// ErrCheckConstraintViolated occurs when there is a check constraint violation
    	ErrCheckConstraintViolated = errors.New("violates check constraint")
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 02:53:17 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  9. cmd/handler-utils.go

    	replaceDirective = "REPLACE"
    	accessDirective  = "ACCESS"
    )
    
    // Parses location constraint from the incoming reader.
    func parseLocationConstraint(r *http.Request) (location string, s3Error APIErrorCode) {
    	// If the request has no body with content-length set to 0,
    	// we do not have to validate location constraint. Bucket will
    	// be created at default region.
    	locationConstraint := createBucketLocationConfiguration{}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 15.5K bytes
    - Viewed (3)
  10. schema/relationship_test.go

    	}
    
    	expectedConstraintName := "fk_my_schema_a_very_very_very_very_very_very_very_very_l4db13eec"
    	constraint := s.Relationships.Relations["Author"].ParseConstraint()
    
    	if constraint.Name != expectedConstraintName {
    		t.Fatalf(
    			"expected constraint name %s, got %s",
    			expectedConstraintName,
    			constraint.Name,
    		)
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 25.5K bytes
    - Viewed (0)
Back to top