- Sort Score
- Num 10 results
- Language All
Results 41 - 50 of 1,084 for gorm (0.02 seconds)
-
tests/count_test.go
package tests_test import ( "regexp" "sort" "strings" "testing" "gorm.io/gorm" . "gorm.io/gorm/utils/tests" ) func TestCountWithGroup(t *testing.T) { DB.Create([]Company{ {Name: "company_count_group_a"}, {Name: "company_count_group_a"}, {Name: "company_count_group_a"}, {Name: "company_count_group_b"}, {Name: "company_count_group_c"}, }) var count1 int64
Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Mon Sep 08 09:19:22 GMT 2025 - 6.8K bytes - Click Count (0) -
model.go
package gorm import "time" // Model a basic GoLang struct which includes the following fields: ID, CreatedAt, UpdatedAt, DeletedAt // It may be embedded into your model or you may build your own model without it // // type User struct { // gorm.Model // } type Model struct { ID uint `gorm:"primarykey"` CreatedAt time.Time UpdatedAt time.Time DeletedAt DeletedAt `gorm:"index"`
Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Sat Feb 18 01:06:43 GMT 2023 - 396 bytes - Click Count (0) -
tests/update_belongs_to_test.go
package tests_test import ( "testing" "gorm.io/gorm" . "gorm.io/gorm/utils/tests" ) func TestUpdateBelongsTo(t *testing.T) { user := *GetUser("update-belongs-to", Config{}) if err := DB.Create(&user).Error; err != nil { t.Fatalf("errors happened when create: %v", err) } user.Company = Company{Name: "company-belongs-to-association"} user.Manager = &User{Name: "manager-belongs-to-association"}
Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Thu Jul 14 06:55:54 GMT 2022 - 1.6K bytes - Click Count (0) -
tests/joins_table_test.go
import ( "testing" "time" "gorm.io/gorm" "gorm.io/gorm/clause" ) type Person struct { ID int Name string Addresses []Address `gorm:"many2many:person_addresses;"` DeletedAt gorm.DeletedAt } type Address struct { ID uint Name string } type PersonAddress struct { PersonID int AddressID int CreatedAt time.Time DeletedAt gorm.DeletedAt }
Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Thu Sep 10 13:46:18 GMT 2020 - 3.5K bytes - Click Count (1) -
tests/update_many2many_test.go
package tests_test import ( "testing" "gorm.io/gorm" . "gorm.io/gorm/utils/tests" ) func TestUpdateMany2ManyAssociations(t *testing.T) { user := *GetUser("update-many2many", Config{}) if err := DB.Create(&user).Error; err != nil { t.Fatalf("errors happened when create: %v", err) } user.Languages = []Language{{Code: "zh-CN", Name: "Chinese"}, {Code: "en", Name: "English"}} for _, lang := range user.Languages {
Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Thu Jan 06 07:02:53 GMT 2022 - 1.3K bytes - Click Count (0) -
tests/gaussdb_test.go
package tests_test import ( "testing" "time" "github.com/google/uuid" "github.com/lib/pq" "gorm.io/gorm" "gorm.io/gorm/clause" . "gorm.io/gorm/utils/tests" ) func TestGaussDBReturningIDWhichHasStringType(t *testing.T) { t.Skipf("This test case skipped, because of gaussdb not support pgcrypto extension and gen_random_uuid() function") if DB.Dialector.Name() != "gaussdb" { t.Skip() } type Yasuo struct {
Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Mon Jul 21 02:46:58 GMT 2025 - 6.6K bytes - Click Count (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)
Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Sat Aug 19 13:33:31 GMT 2023 - 2.2K bytes - Click Count (0) -
chainable_api.go
// // func AmountGreaterThan1000(db *gorm.DB) *gorm.DB { // return db.Where("amount > ?", 1000) // } // // func OrderStatus(status []string) func (db *gorm.DB) *gorm.DB { // return func (db *gorm.DB) *gorm.DB { // return db.Scopes(AmountGreaterThan1000).Where("status in (?)", status) // } // } //
Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Fri Sep 19 01:49:06 GMT 2025 - 14.8K bytes - Click Count (0) -
tests/preload_test.go
package tests_test import ( "context" "encoding/json" "regexp" "sort" "strconv" "sync" "testing" "time" "gorm.io/gorm" "gorm.io/gorm/clause" . "gorm.io/gorm/utils/tests" ) func TestPreloadWithAssociations(t *testing.T) { user := *GetUser("preload_with_associations", Config{ Account: true, Pets: 2, Toys: 3, Company: true, Manager: true, Team: 4,
Created: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Wed Jun 12 10:00:47 GMT 2024 - 15.9K bytes - Click Count (0) -
.github/workflows/tests.yml
services: mysql: image: ${{ matrix.dbversion }} env: MYSQL_DATABASE: gorm MYSQL_USER: gorm MYSQL_PASSWORD: gorm MYSQL_RANDOM_ROOT_PASSWORD: "yes" ports: - 9910:3306 options: >- --health-cmd "mysqladmin ping -ugorm -pgorm" --health-interval 10s --health-start-period 10s --health-timeout 5sCreated: Sun Dec 28 09:35:17 GMT 2025 - Last Modified: Mon Sep 08 09:19:22 GMT 2025 - 8.9K bytes - Click Count (0)