Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for str (0.23 sec)

  1. schema/naming.go

    }
    
    // JoinTableName convert string to join table name
    func (ns NamingStrategy) JoinTableName(str string) string {
    	if !ns.NoLowerCase && strings.ToLower(str) == str {
    		return ns.TablePrefix + str
    	}
    
    	if ns.SingularTable {
    		return ns.TablePrefix + ns.toDBName(str)
    	}
    	return ns.TablePrefix + inflection.Plural(ns.toDBName(str))
    }
    
    // RelationshipFKName generate fk name for relation
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 5.2K bytes
    - Viewed (0)
  2. migrator/migrator.go

    	for _, opt := range opts {
    		str := stmt.Quote(opt.DBName)
    		if opt.Expression != "" {
    			str = opt.Expression
    		} else if opt.Length > 0 {
    			str += fmt.Sprintf("(%d)", opt.Length)
    		}
    
    		if opt.Collate != "" {
    			str += " COLLATE " + opt.Collate
    		}
    
    		if opt.Sort != "" {
    			str += " " + opt.Sort
    		}
    		results = append(results, clause.Expr{SQL: str})
    	}
    	return
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  3. schema/callbacks_test.go

    	if err != nil {
    		t.Fatalf("failed to parse user with callback, got error %v", err)
    	}
    
    	for _, str := range []string{"BeforeSave", "AfterCreate"} {
    		if !reflect.Indirect(reflect.ValueOf(user)).FieldByName(str).Interface().(bool) {
    			t.Errorf("%v should be true", str)
    		}
    	}
    
    	for _, str := range []string{"BeforeCreate", "BeforeUpdate", "AfterUpdate", "AfterSave", "BeforeDelete", "AfterDelete", "AfterFind"} {
    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

    	"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 {
    				if names[j][len(names[j])-1] == '\\' {
    					i++
    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. utils/tests/dummy_dialecter.go

    	writer.WriteByte('?')
    }
    
    func (DummyDialector) QuoteTo(writer clause.Writer, str string) {
    	var (
    		underQuoted, selfQuoted bool
    		continuousBacktick      int8
    		shiftDelimiter          int8
    	)
    
    	for _, v := range []byte(str) {
    		switch v {
    		case '`':
    			continuousBacktick++
    			if continuousBacktick == 2 {
    				writer.WriteString("``")
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 06 06:03:31 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  6. statement.go

    }
    
    // QuoteTo write quoted value to writer
    func (stmt *Statement) QuoteTo(writer clause.Writer, field interface{}) {
    	write := func(raw bool, str string) {
    		if raw {
    			writer.WriteString(str)
    		} else {
    			stmt.DB.Dialector.QuoteTo(writer, str)
    		}
    	}
    
    	switch v := field.(type) {
    	case clause.Table:
    		if v.Name == clause.CurrentTable {
    			if stmt.TableExpr != nil {
    				stmt.TableExpr.Build(stmt)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  7. tests/embedded_struct_test.go

    }
    
    func (c *Content) Scan(src interface{}) error {
    	var value Content
    	str, ok := src.(string)
    	if !ok {
    		byt, ok := src.([]byte)
    		if !ok {
    			return errors.New("Embedded.Scan byte assertion failed")
    		}
    		if err := json.Unmarshal(byt, &value); err != nil {
    			return err
    		}
    	} else {
    		if err := json.Unmarshal([]byte(str), &value); err != nil {
    			return err
    		}
    	}
    
    	*c = value
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Oct 26 03:58:13 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  8. callbacks.go

    	c.processor.callbacks = append(c.processor.callbacks, c)
    	return c.processor.compile()
    }
    
    // getRIndex get right index from string slice
    func getRIndex(strs []string, str string) int {
    	for i := len(strs) - 1; i >= 0; i-- {
    		if strs[i] == str {
    			return i
    		}
    	}
    	return -1
    }
    
    func sortCallbacks(cs []*callback) (fns []func(*DB), err error) {
    	var (
    		names, sorted []string
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 8.6K bytes
    - Viewed (1)
  9. schema/relationship.go

    	return
    }
    
    func (rel *Relationship) ParseConstraint() *Constraint {
    	str := rel.Field.TagSettings["CONSTRAINT"]
    	if str == "-" {
    		return nil
    	}
    
    	if rel.Type == BelongsTo {
    		for _, r := range rel.FieldSchema.Relationships.Relations {
    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)
  10. tests/sql_builder_test.go

    	newDB.Joins("inner join rgs on rgs.id = user.id")
    
    	stmt := newDB.First(&result).Statement
    	str := stmt.SQL.String()
    
    	if !strings.Contains(str, "rgs.id = user.id") {
    		t.Errorf("The second join condition is over written instead of combining")
    	}
    
    	if !strings.Contains(str, "`users`.`company_id` = `companies`.`id`") && !strings.Contains(str, "\"users\".\"company_id\" = \"companies\".\"id\"") {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
Back to top