Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestGORMValuer (0.2 sec)

  1. tests/scanner_valuer_test.go

    func (point Point) GormValue(ctx context.Context, db *gorm.DB) clause.Expr {
    	return clause.Expr{
    		SQL:  "ST_PointFromText(?)",
    		Vars: []interface{}{fmt.Sprintf("POINT(%d %d)", point.X, point.Y)},
    	}
    }
    
    func TestGORMValuer(t *testing.T) {
    	type UserWithPoint struct {
    		Name  string
    		Point Point
    	}
    
    	dryRunDB := DB.Session(&gorm.Session{DryRun: true})
    
    	stmt := dryRunDB.Create(&UserWithPoint{
    		Name:  "jinzhu",
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Wed Jun 07 07:02:07 GMT 2023
    - 10.6K bytes
    - Viewed (0)
Back to top