- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 37 for dialects (0.05 sec)
-
tests/tests_all.sh
fi cd .. fi fi for dialect in "${dialects[@]}" ; do if [ "$GORM_DIALECT" = "" ] || [ "$GORM_DIALECT" = "${dialect}" ] then echo "testing ${dialect}..." if [ "$GORM_VERBOSE" = "" ] then GORM_DIALECT=${dialect} go test -race -count=1 ./... if [ -d tests ] then cd tests GORM_DIALECT=${dialect} go test -race -count=1 ./... cd .. fi
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Sep 30 03:21:19 UTC 2024 - 1.7K bytes - Viewed (0) -
tests/gorm_test.go
if err == nil { t.Fatalf("should returns error but got nil") } } func TestReturningWithNullToZeroValues(t *testing.T) { dialect := DB.Dialector.Name() switch dialect { case "mysql", "sqlserver": // 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.
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Thu Jun 01 07:22:21 UTC 2023 - 3.3K bytes - Viewed (0) -
tests/sql_builder_test.go
} func TestToSQL(t *testing.T) { // By default DB.DryRun should false if DB.DryRun { t.Fatal("Failed expect DB.DryRun to be false") } if DB.Dialector.Name() == "sqlserver" { t.Skip("Skip SQL Server for this test, because it too difference with other dialects.") } date, _ := time.ParseInLocation("2006-01-02", "2021-10-18", time.Local) // find sql := DB.ToSQL(func(tx *gorm.DB) *gorm.DB {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Jan 12 08:42:21 UTC 2024 - 16.7K bytes - Viewed (0) -
tests/error_translator_test.go
db, err := OpenTestConnection(&gorm.Config{TranslateError: true}) if err != nil { t.Fatalf("failed to connect database, got error %v", err) } dialectors := map[string]bool{"sqlite": true, "postgres": true, "mysql": true, "sqlserver": true} if supported, found := dialectors[db.Dialector.Name()]; !(found && supported) { return } DB.Migrator().DropTable(&City{}) if err = db.AutoMigrate(&City{}); err != nil {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Jul 12 13:21:22 UTC 2023 - 3.1K bytes - Viewed (0) -
gorm.go
} if config.Dialector != nil { err = config.Dialector.Initialize(db) if err != nil { if db, _ := db.DB(); db != nil { _ = db.Close() } } if config.TranslateError { if _, ok := db.Dialector.(ErrorTranslator); !ok {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Oct 09 11:29:48 UTC 2024 - 12.1K bytes - Viewed (0) -
interfaces.go
package gorm import ( "context" "database/sql" "gorm.io/gorm/clause" "gorm.io/gorm/schema" ) // Dialector GORM database dialector type Dialector interface { Name() string Initialize(*DB) error Migrator(db *DB) Migrator DataTypeOf(*schema.Field) string DefaultValueOf(*schema.Field) clause.Expression BindVarTo(writer clause.Writer, stmt *Statement, v interface{}) QuoteTo(clause.Writer, string)
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Sat Aug 19 13:33:31 UTC 2023 - 2.2K bytes - Viewed (0) -
tests/postgres_test.go
"time" "github.com/google/uuid" "github.com/lib/pq" "gorm.io/gorm" "gorm.io/gorm/clause" . "gorm.io/gorm/utils/tests" ) func TestPostgresReturningIDWhichHasStringType(t *testing.T) { if DB.Dialector.Name() != "postgres" { t.Skip() } type Yasuo struct { ID string `gorm:"default:gen_random_uuid()"` Name string CreatedAt time.Time `gorm:"type:TIMESTAMP WITHOUT TIME ZONE"`
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Sat Oct 08 09:16:32 UTC 2022 - 6.4K bytes - Viewed (0) -
tests/connection_test.go
import ( "fmt" "testing" "gorm.io/driver/mysql" "gorm.io/gorm" ) func TestWithSingleConnection(t *testing.T) { expectedName := "test" var actualName string setSQL, getSQL := getSetSQL(DB.Dialector.Name()) if len(setSQL) == 0 || len(getSQL) == 0 { return } err := DB.Connection(func(tx *gorm.DB) error { if err := tx.Exec(setSQL, expectedName).Error; err != nil { return err }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Jan 28 14:16:42 UTC 2022 - 963 bytes - Viewed (0) -
tests/delete_test.go
} } } // only sqlite, postgres, sqlserver support returning func TestSoftDeleteReturning(t *testing.T) { if DB.Dialector.Name() != "sqlite" && DB.Dialector.Name() != "postgres" && DB.Dialector.Name() != "sqlserver" { return } users := []*User{ GetUser("delete-returning-1", Config{}), GetUser("delete-returning-2", Config{}),
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Tue Oct 10 07:03:34 UTC 2023 - 9.4K bytes - Viewed (0) -
statement.go
writer.WriteByte(')') case clause.Expr: v.Build(stmt) case string: stmt.DB.Dialector.QuoteTo(writer, v) case []string: writer.WriteByte('(') for idx, d := range v { if idx > 0 { writer.WriteByte(',') } stmt.DB.Dialector.QuoteTo(writer, d) } writer.WriteByte(')') default: stmt.DB.Dialector.QuoteTo(writer, fmt.Sprint(field)) } } // Quote returns quoted value
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Jun 24 09:42:59 UTC 2024 - 19.9K bytes - Viewed (0)