Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 928 for gorm (4.93 sec)

  1. gorm.go

    package gorm
    
    import (
    	"context"
    	"database/sql"
    	"fmt"
    	"reflect"
    	"sort"
    	"sync"
    	"time"
    
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/logger"
    	"gorm.io/gorm/schema"
    )
    
    // for Config.cacheStore store PreparedStmtDB key
    const preparedStmtDBKey = "preparedStmt"
    
    // Config GORM config
    type Config struct {
    	// GORM perform single create, update, delete operations in transactions by default to ensure database data integrity
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Tue Aug 26 06:24:29 UTC 2025
    - 12.8K bytes
    - Viewed (0)
  2. README.md

    ## Getting Started
    
    * GORM Guides [https://gorm.io](https://gorm.io)
    * Gen Guides [https://gorm.io/gen/index.html](https://gorm.io/gen/index.html)
    
    ## Contributing
    
    [You can help to deliver a better GORM, check out things you can do](https://gorm.io/contribute.html)
    
    ## Contributors
    
    [Thank you](https://github.com/go-gorm/gorm/graphs/contributors) for contributing to the GORM framework!
    
    ## License
    
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Tue Nov 07 02:20:06 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  3. tests/tests_test.go

    	"os"
    	"path/filepath"
    	"time"
    
    	"gorm.io/driver/gaussdb"
    	"gorm.io/driver/mysql"
    	"gorm.io/driver/postgres"
    	"gorm.io/driver/sqlite"
    	"gorm.io/driver/sqlserver"
    	"gorm.io/gorm"
    	"gorm.io/gorm/logger"
    	. "gorm.io/gorm/utils/tests"
    )
    
    var DB *gorm.DB
    var (
    	mysqlDSN     = "gorm:gorm@tcp(localhost:9910)/gorm?charset=utf8&parseTime=True&loc=Local"
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Mon Jul 21 02:46:58 UTC 2025
    - 3.7K bytes
    - Viewed (0)
  4. schema/index_test.go

    package schema_test
    
    import (
    	"sync"
    	"testing"
    
    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils/tests"
    )
    
    type UserIndex struct {
    	Name         string `gorm:"index"`
    	Name2        string `gorm:"index:idx_name,unique"`
    	Name3        string `gorm:"index:,sort:desc,collate:utf8,type:btree,length:10,where:name3 != 'jinzhu'"`
    	Name4        string `gorm:"uniqueIndex"`
    	Name5        int64  `gorm:"index:,class:FULLTEXT,comment:hello \\, world,where:age > 10"`
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Fri Dec 06 02:27:44 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  5. tests/default_value_test.go

    import (
    	"testing"
    	"time"
    
    	"gorm.io/gorm"
    )
    
    func TestDefaultValue(t *testing.T) {
    	type Harumph struct {
    		gorm.Model
    		Email   string    `gorm:"not null;index:,unique"`
    		Name    string    `gorm:"notNull;default:foo"`
    		Name2   string    `gorm:"size:233;not null;default:'foo'"`
    		Name3   string    `gorm:"size:233;notNull;default:''"`
    		Age     int       `gorm:"default:18"`
    		Created time.Time `gorm:"default:2000-01-02"`
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Mon Apr 08 03:29:55 UTC 2024
    - 2.3K bytes
    - Viewed (0)
  6. tests/error_translator_test.go

    package tests_test
    
    import (
    	"errors"
    	"testing"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/utils/tests"
    )
    
    func TestDialectorWithErrorTranslatorSupport(t *testing.T) {
    	// it shouldn't translate error when the TranslateError flag is false
    	translatedErr := errors.New("translated error")
    	untranslatedErr := errors.New("some random error")
    	db, _ := gorm.Open(tests.DummyDialector{TranslatedErr: translatedErr})
    
    	err := db.AddError(untranslatedErr)
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Mon Jul 21 02:46:58 UTC 2025
    - 3.1K bytes
    - Viewed (0)
  7. schema/utils_test.go

    		`gorm:"column:db" other:"before:value;column:db;after:value"`:                           `gorm:"" other:"before:value;column:db;after:value"`,
    		`gorm:"before:value;column:db ;after:value" other:"before:value;column:db;after:value"`: `gorm:"before:value;after:value" other:"before:value;column:db;after:value"`,
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Fri Jul 31 10:19:25 UTC 2020
    - 1.5K bytes
    - Viewed (0)
  8. callbacks/interfaces.go

    package callbacks
    
    import "gorm.io/gorm"
    
    type BeforeCreateInterface interface {
    	BeforeCreate(*gorm.DB) error
    }
    
    type AfterCreateInterface interface {
    	AfterCreate(*gorm.DB) error
    }
    
    type BeforeUpdateInterface interface {
    	BeforeUpdate(*gorm.DB) error
    }
    
    type AfterUpdateInterface interface {
    	AfterUpdate(*gorm.DB) error
    }
    
    type BeforeSaveInterface interface {
    	BeforeSave(*gorm.DB) error
    }
    
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Thu Aug 27 07:03:57 UTC 2020
    - 667 bytes
    - Viewed (0)
  9. tests/generics_test.go

    	"sort"
    	"strconv"
    	"strings"
    	"sync"
    	"testing"
    
    	"github.com/google/uuid"
    	"gorm.io/driver/mysql"
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    	. "gorm.io/gorm/utils/tests"
    )
    
    func TestGenericsCreate(t *testing.T) {
    	ctx := context.Background()
    
    	user := User{Name: "TestGenericsCreate", Age: 18}
    	err := gorm.G[User](DB).Create(ctx, &user)
    	if err != nil {
    		t.Fatalf("Create failed: %v", err)
    	}
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Thu Sep 04 13:13:16 UTC 2025
    - 28K bytes
    - Viewed (0)
  10. tests/serializer_test.go

    	"fmt"
    	"reflect"
    	"strings"
    	"testing"
    	"time"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/schema"
    	. "gorm.io/gorm/utils/tests"
    )
    
    type SerializerStruct struct {
    	gorm.Model
    	Name                   []byte                 `gorm:"json"`
    	Roles                  Roles                  `gorm:"serializer:json"`
    	Roles2                 *Roles                 `gorm:"serializer:json"`
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Mon Jul 21 02:46:58 UTC 2025
    - 7.6K bytes
    - Viewed (0)
Back to top