Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for NullString (0.13 sec)

  1. soft_delete.go

    }
    
    func parseZeroValueTag(f *schema.Field) sql.NullString {
    	if v, ok := f.TagSettings["ZEROVALUE"]; ok {
    		if _, err := now.Parse(v); err == nil {
    			return sql.NullString{String: v, Valid: true}
    		}
    	}
    	return sql.NullString{Valid: false}
    }
    
    type SoftDeleteQueryClause struct {
    	ZeroValue sql.NullString
    	Field     *schema.Field
    }
    
    func (sd SoftDeleteQueryClause) Name() string {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Feb 01 06:40:55 UTC 2023
    - 4.5K bytes
    - Viewed (0)
  2. migrator/column_type.go

    import (
    	"database/sql"
    	"reflect"
    )
    
    // ColumnType column type implements ColumnType interface
    type ColumnType struct {
    	SQLColumnType      *sql.ColumnType
    	NameValue          sql.NullString
    	DataTypeValue      sql.NullString
    	ColumnTypeValue    sql.NullString
    	PrimaryKeyValue    sql.NullBool
    	UniqueValue        sql.NullBool
    	AutoIncrementValue sql.NullBool
    	LengthValue        sql.NullInt64
    	DecimalSizeValue   sql.NullInt64
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Mar 24 01:31:58 UTC 2022
    - 3.3K bytes
    - Viewed (0)
  3. tests/scanner_valuer_test.go

    	}
    
    	data := ScannerValuerStruct{
    		Name:     sql.NullString{String: "name", Valid: true},
    		Gender:   &sql.NullString{String: "M", Valid: true},
    		Age:      sql.NullInt64{Int64: 18, Valid: true},
    		Male:     sql.NullBool{Bool: true, Valid: true},
    		Height:   sql.NullFloat64{Float64: 1.8888, Valid: true},
    		Birthday: sql.NullTime{Time: time.Now(), Valid: true},
    		Allergen: NullString{sql.NullString{String: "Allergen", Valid: true}},
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 07 07:02:07 UTC 2023
    - 10.6K bytes
    - Viewed (0)
  4. migrator/table_type.go

    package migrator
    
    import (
    	"database/sql"
    )
    
    // TableType table type implements TableType interface
    type TableType struct {
    	SchemaValue  string
    	NameValue    string
    	TypeValue    string
    	CommentValue sql.NullString
    }
    
    // Schema returns the schema of the table.
    func (ct TableType) Schema() string {
    	return ct.SchemaValue
    }
    
    // Name returns the name of the table.
    func (ct TableType) Name() string {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Fri May 05 07:58:27 UTC 2023
    - 688 bytes
    - Viewed (0)
  5. schema/model_test.go

    	Active    *bool
    }
    
    type (
    	mytime time.Time
    	myint  int
    	mybool = bool
    )
    
    type AdvancedDataTypeUser struct {
    	ID           sql.NullInt64
    	Name         *sql.NullString
    	Birthday     sql.NullTime
    	RegisteredAt mytime
    	DeletedAt    *mytime
    	Active       mybool
    	Admin        *mybool
    }
    
    type BaseModel struct {
    	ID        uint
    	CreatedAt time.Time
    	CreatedBy *int
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Jan 06 07:02:53 UTC 2022
    - 1.1K bytes
    - Viewed (0)
  6. schema/field_test.go

    	newValues["active"] = false
    	checkField(t, userSchema, reflectValue, newValues)
    
    	// test valuer and other type
    	age := myint(10)
    	var nilTime *time.Time
    	newValues2 := map[string]interface{}{
    		"name":       sql.NullString{String: "valuer_and_setter_3", Valid: true},
    		"id":         &sql.NullInt64{Int64: 3, Valid: true},
    		"created_at": tests.Now(),
    		"updated_at": nilTime,
    		"deleted_at": time.Now(),
    		"age":        &age,
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sat Feb 19 09:02:53 UTC 2022
    - 12.7K bytes
    - Viewed (0)
  7. src/database/sql/convert_test.go

    	c       driver.ValueConverter
    	in, out any
    	err     string
    }
    
    var valueConverterTests = []valueConverterTest{
    	{driver.DefaultParameterConverter, NullString{"hi", true}, "hi", ""},
    	{driver.DefaultParameterConverter, NullString{"", false}, nil, ""},
    }
    
    func TestValueConverters(t *testing.T) {
    	for i, tt := range valueConverterTests {
    		out, err := tt.c.ConvertValue(tt.in)
    		goterr := ""
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 10 20:23:22 UTC 2024
    - 17K bytes
    - Viewed (0)
  8. src/database/sql/sql_test.go

    	spec := nullTestSpec{"nullstring", "string", [6]nullTestRow{
    		{NullString{"aqua", true}, "", NullString{"aqua", true}},
    		{NullString{"brown", false}, "", NullString{"", false}},
    		{"chartreuse", "", NullString{"chartreuse", true}},
    		{NullString{"darkred", true}, "", NullString{"darkred", true}},
    		{NullString{"eel", false}, "", NullString{"", false}},
    		{"foo", NullString{"black", false}, nil},
    	}}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 111.6K bytes
    - Viewed (0)
  9. src/database/sql/sql.go

    type RawBytes []byte
    
    // NullString represents a string that may be null.
    // NullString implements the [Scanner] interface so
    // it can be used as a scan destination:
    //
    //	var s NullString
    //	err := db.QueryRow("SELECT name FROM foo WHERE id=?", id).Scan(&s)
    //	...
    //	if s.Valid {
    //	   // use s.String
    //	} else {
    //	   // NULL value
    //	}
    type NullString struct {
    	String string
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:16:53 UTC 2024
    - 103.6K bytes
    - Viewed (0)
  10. clause/expression_test.go

    			clause.Eq{Column: column, Value: (*int)(nil)},
    			clause.Eq{Column: column, Value: (*bool)(nil)},
    			clause.Eq{Column: column, Value: (interface{})(nil)},
    			clause.Eq{Column: column, Value: sql.NullString{String: "", Valid: false}},
    		},
    		Result: "`column-name` IS NULL",
    	}, {
    		Expressions: []clause.Expression{
    			clause.Neq{Column: column, Value: "column-value"},
    		},
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Aug 10 05:34:33 UTC 2023
    - 8.4K bytes
    - Viewed (0)
Back to top