Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for nulla (0.19 sec)

  1. tests/connpool_test.go

    			"INSERT INTO `users` (`created_at`,`updated_at`,`deleted_at`,`name`,`age`,`birthday`,`company_id`,`manager_id`,`active`) VALUES (?,?,?,?,?,?,?,?,?)",
    			"SELECT * FROM `users` WHERE name = ? AND `users`.`deleted_at` IS NULL ORDER BY `users`.`id` LIMIT ?",
    			"SELECT * FROM `users` WHERE name = ? AND `users`.`deleted_at` IS NULL ORDER BY `users`.`id` LIMIT ?",
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Feb 06 02:54:40 GMT 2024
    - 5.5K bytes
    - Viewed (0)
  2. tests/soft_delete_test.go

    		t.Fatalf("invalid sql generated, got %v", sql)
    	}
    
    	sql = DB.Session(&gorm.Session{DryRun: true}).Table("user u").Select("name").Find(&User{}).Statement.SQL.String()
    	if !regexp.MustCompile(`SELECT .name. FROM user u WHERE .u.\..deleted_at. IS NULL`).MatchString(sql) {
    		t.Errorf("Table with escape character, got %v", sql)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Feb 01 06:40:55 GMT 2023
    - 5.7K bytes
    - Viewed (0)
  3. schema/serializer.go

    func (JSONSerializer) Value(ctx context.Context, field *Field, dst reflect.Value, fieldValue interface{}) (interface{}, error) {
    	result, err := json.Marshal(fieldValue)
    	if string(result) == "null" {
    		if field.TagSettings["NOT NULL"] != "" {
    			return "", nil
    		}
    		return nil, err
    	}
    	return string(result), err
    }
    
    // UnixSecondSerializer json serializer
    type UnixSecondSerializer struct{}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 08:28:46 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  4. tests/embedded_struct_test.go

    	}
    }
    
    type Content struct {
    	Content interface{} `gorm:"type:String"`
    }
    
    func (c Content) Value() (driver.Value, error) {
    	// mssql driver with issue on handling null bytes https://github.com/denisenkom/go-mssqldb/issues/530,
    	b, err := json.Marshal(c)
    	return string(b[:]), err
    }
    
    func (c *Content) Scan(src interface{}) error {
    	var value Content
    	str, ok := src.(string)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Oct 26 03:58:13 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  5. clause/expression.go

    		if rv.Len() == 0 {
    			builder.WriteString(" IN (NULL)")
    		} else {
    			builder.WriteString(" IN (")
    			for i := 0; i < rv.Len(); i++ {
    				if i > 0 {
    					builder.WriteByte(',')
    				}
    				builder.AddVar(builder, rv.Index(i).Interface())
    			}
    			builder.WriteByte(')')
    		}
    	default:
    		if eqNil(eq.Value) {
    			builder.WriteString(" IS NULL")
    		} else {
    			builder.WriteString(" = ")
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 06:45:48 GMT 2023
    - 8.3K bytes
    - Viewed (0)
  6. tests/postgres_test.go

    	if DB.Dialector.Name() != "postgres" {
    		t.Skip()
    	}
    
    	type Harumph struct {
    		gorm.Model
    		Name      string         `gorm:"check:name_checker,name <> ''"`
    		Test      uuid.UUID      `gorm:"type:uuid;not null;default:gen_random_uuid()"`
    		CreatedAt time.Time      `gorm:"type:TIMESTAMP WITHOUT TIME ZONE"`
    		UpdatedAt time.Time      `gorm:"type:TIMESTAMP WITHOUT TIME ZONE;default:current_timestamp"`
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Oct 08 09:16:32 GMT 2022
    - 6.4K bytes
    - Viewed (3)
  7. soft_delete.go

    }
    
    func (n DeletedAt) MarshalJSON() ([]byte, error) {
    	if n.Valid {
    		return json.Marshal(n.Time)
    	}
    	return json.Marshal(nil)
    }
    
    func (n *DeletedAt) UnmarshalJSON(b []byte) error {
    	if string(b) == "null" {
    		n.Valid = false
    		return nil
    	}
    	err := json.Unmarshal(b, &n.Time)
    	if err == nil {
    		n.Valid = true
    	}
    	return err
    }
    
    func (DeletedAt) QueryClauses(f *schema.Field) []clause.Interface {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Feb 01 06:40:55 GMT 2023
    - 4.5K bytes
    - Viewed (0)
  8. logger/sql.go

    	"reflect"
    	"regexp"
    	"strconv"
    	"strings"
    	"time"
    	"unicode"
    
    	"gorm.io/gorm/utils"
    )
    
    const (
    	tmFmtWithMS = "2006-01-02 15:04:05.999"
    	tmFmtZero   = "0000-00-00 00:00:00"
    	nullStr     = "NULL"
    )
    
    func isPrintable(s string) bool {
    	for _, r := range s {
    		if !unicode.IsPrint(r) {
    			return false
    		}
    	}
    	return true
    }
    
    // A list of Go types that should be converted to SQL primitives
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 5K bytes
    - Viewed (0)
  9. logger/sql_test.go

    			Result:        `create table users (name, age, height, actived, bytes, create_at, update_at, deleted_at, email, role, pass) values ("jinzhu", 1, 999.99, true, "12345", "2020-02-23 11:10:10", "2020-02-23 11:10:10", NULL, "w@g.""com", "admin", "pass")`,
    		},
    		{
    			SQL:           "create table users (name, age, height, actived, bytes, create_at, update_at, deleted_at, email, role, pass) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  10. tests/gorm_test.go

    		// these dialects do not support the "returning" clause
    		return
    	default:
    		// This user struct will leverage the existing users table, but override
    		// the Name field to default to null.
    		type user struct {
    			gorm.Model
    			Name string `gorm:"default:null"`
    		}
    		u1 := user{}
    
    		if results := DB.Create(&u1); results.Error != nil {
    			t.Fatalf("errors happened on create: %v", results.Error)
    		} else if results.RowsAffected != 1 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jun 01 07:22:21 GMT 2023
    - 3.3K bytes
    - Viewed (0)
Back to top