- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 17 for Assert (0.38 sec)
-
tests/scanner_valuer_test.go
if stmt.SQL.String() == "" || len(stmt.Vars) != 2 { t.Errorf("Failed to generate sql, got %v", stmt.SQL.String()) } if !regexp.MustCompile(`INSERT INTO .user_with_points. \(.name.,.point.\) VALUES \(.+,ST_PointFromText\(.+\)\)`).MatchString(stmt.SQL.String()) { t.Errorf("insert with sql.Expr, but got %v", stmt.SQL.String()) } if !reflect.DeepEqual([]interface{}{"jinzhu", "POINT(100 100)"}, stmt.Vars) {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Wed Jun 07 07:02:07 GMT 2023 - 10.6K bytes - Viewed (0) -
prepare_stmt.go
// 1. g1 begin tx, g1 is requeue because of waiting for the system call, now `db.ConnPool` db.numOpen == 1. // 2. g2 select lock `conn.PrepareContext(ctx, query)`, now db.numOpen == db.maxOpen , wait for release. // 3. g1 tx exec insert, wait for unlock `conn.PrepareContext(ctx, query)` to finish tx and release. stmt, err := conn.PrepareContext(ctx, query) if err != nil { cacheStmt.prepareErr = err db.Mux.Lock() delete(db.Stmts, query)
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Thu Mar 28 08:47:39 GMT 2024 - 6.4K bytes - Viewed (0) -
tests/upsert_test.go
} } func TestUpsertSlice(t *testing.T) { langs := []Language{ {Code: "upsert-slice1", Name: "Upsert-slice1"}, {Code: "upsert-slice2", Name: "Upsert-slice2"}, {Code: "upsert-slice3", Name: "Upsert-slice3"}, } DB.Clauses(clause.OnConflict{DoNothing: true}).Create(&langs) var langs2 []Language if err := DB.Find(&langs2, "code LIKE ?", "upsert-slice%").Error; err != nil {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Mon Sep 05 07:39:19 GMT 2022 - 11.4K bytes - Viewed (0) -
README.md
* Eager loading with `Preload`, `Joins` * Transactions, Nested Transactions, Save Point, RollbackTo to Saved Point * Context, Prepared Statement Mode, DryRun Mode * Batch Insert, FindInBatches, Find To Map * SQL Builder, Upsert, Locking, Optimizer/Index/Comment Hints, NamedArg, Search/Update/Create with SQL Expr * Composite Primary Key * Auto Migrations * Logger
Plain Text - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Tue Nov 07 02:20:06 GMT 2023 - 1.8K bytes - Viewed (0) -
utils/tests/dummy_dialecter.go
} func (DummyDialector) Name() string { return "dummy" } func (DummyDialector) Initialize(db *gorm.DB) error { callbacks.RegisterDefaultCallbacks(db, &callbacks.Config{ CreateClauses: []string{"INSERT", "VALUES", "ON CONFLICT", "RETURNING"}, UpdateClauses: []string{"UPDATE", "SET", "WHERE", "RETURNING"}, DeleteClauses: []string{"DELETE", "FROM", "WHERE", "RETURNING"}, LastInsertIDReversed: true, })
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Mon Mar 06 06:03:31 GMT 2023 - 2.2K bytes - Viewed (0) -
callbacks/callbacks.go
package callbacks import ( "gorm.io/gorm" ) var ( createClauses = []string{"INSERT", "VALUES", "ON CONFLICT"} queryClauses = []string{"SELECT", "FROM", "WHERE", "GROUP BY", "ORDER BY", "LIMIT", "FOR"} updateClauses = []string{"UPDATE", "SET", "WHERE"} deleteClauses = []string{"DELETE", "FROM", "WHERE"} ) type Config struct { LastInsertIDReversed bool CreateClauses []string QueryClauses []string
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Wed Oct 27 23:56:55 GMT 2021 - 3.3K bytes - Viewed (0) -
tests/migrate_test.go
package tests_test import ( "context" "database/sql" "fmt" "math/rand" "os" "reflect" "strconv" "strings" "testing" "time" "github.com/stretchr/testify/assert" "gorm.io/driver/postgres" "gorm.io/gorm" "gorm.io/gorm/clause" "gorm.io/gorm/logger" "gorm.io/gorm/migrator" "gorm.io/gorm/schema" "gorm.io/gorm/utils" . "gorm.io/gorm/utils/tests" ) func TestMigrate(t *testing.T) {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Mon Mar 18 11:24:16 GMT 2024 - 56.2K bytes - Viewed (0) -
tests/serializer_test.go
JobInfo: Job{ Title: "programmer", Number: 9920, Location: "Shadyside", IsIntern: false, }, CustomSerializerString: "world", } // first time insert record out := SerializerStruct{} if err := DB.Assign(data).FirstOrCreate(&out).Error; err != nil { t.Fatalf("failed to FirstOrCreate Assigned data, got error %v", err) } var result SerializerStruct
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Fri Apr 21 14:09:38 GMT 2023 - 7.6K bytes - Viewed (0) -
clause/insert_test.go
Vars []interface{} }{ { []clause.Interface{clause.Insert{}}, "INSERT INTO `users`", nil, }, { []clause.Interface{clause.Insert{Modifier: "LOW_PRIORITY"}}, "INSERT LOW_PRIORITY INTO `users`", nil, }, { []clause.Interface{clause.Insert{Table: clause.Table{Name: "products"}, Modifier: "LOW_PRIORITY"}}, "INSERT LOW_PRIORITY INTO `products`", nil, }, }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Tue Jun 02 01:18:01 GMT 2020 - 737 bytes - Viewed (0) -
tests/table_test.go
} r = dryDB.Create(&UserWithTable{}).Statement if DB.Dialector.Name() != "sqlite" { if !regexp.MustCompile(`INSERT INTO .gorm.\..user. (.*name.*) VALUES (.*)`).MatchString(r.Statement.SQL.String()) { t.Errorf("Table with escape character, got %v", r.Statement.SQL.String()) } } else { if !regexp.MustCompile(`INSERT INTO .user. (.*name.*) VALUES (.*)`).MatchString(r.Statement.SQL.String()) {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Sat Mar 09 09:31:28 GMT 2024 - 10.6K bytes - Viewed (0)