Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for DSN (0.08 sec)

  1. tests/gorm_test.go

    package tests_test
    
    import (
    	"testing"
    
    	"gorm.io/driver/mysql"
    
    	"gorm.io/gorm"
    )
    
    func TestOpen(t *testing.T) {
    	dsn := "gorm:gorm@tcp(localhost:9910)/gorm?loc=Asia%2FHongKong" // invalid loc
    	_, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})
    	if err == nil {
    		t.Fatalf("should returns error but got nil")
    	}
    }
    
    func TestReturningWithNullToZeroValues(t *testing.T) {
    	dialect := DB.Dialector.Name()
    	switch dialect {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Jun 01 07:22:21 UTC 2023
    - 3.3K bytes
    - Viewed (0)
  2. tests/tests_test.go

    		}
    		db, err = gorm.Open(mysql.Open(dbDSN), cfg)
    	case "postgres":
    		log.Println("testing postgres...")
    		if dbDSN == "" {
    			dbDSN = postgresDSN
    		}
    		db, err = gorm.Open(postgres.New(postgres.Config{
    			DSN:                  dbDSN,
    			PreferSimpleProtocol: true,
    		}), cfg)
    	case "sqlserver":
    		// go install github.com/microsoft/go-sqlcmd/cmd/sqlcmd@latest
    		// SQLCMDPASSWORD=LoremIpsum86 sqlcmd -U sa -S localhost:9930
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Fri Dec 15 08:36:08 UTC 2023
    - 3.3K bytes
    - Viewed (0)
Back to top