Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 1,277 for gorm (0.14 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
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sun Aug 20 11:46:56 GMT 2023
    - 11.6K bytes
    - Viewed (0)
  2. 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 {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Thu Jun 01 07:22:21 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  3. 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
    
    Plain Text
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue Nov 07 02:20:06 GMT 2023
    - 1.8K 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"`
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 8K bytes
    - Viewed (0)
  5. tests/tests_test.go

    	"os"
    	"path/filepath"
    	"time"
    
    	"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"
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 3.3K bytes
    - Viewed (1)
  6. callbacks/callbacks.go

    	createCallback.Match(enableTransaction).Register("gorm:begin_transaction", BeginTransaction)
    	createCallback.Register("gorm:before_create", BeforeCreate)
    	createCallback.Register("gorm:save_before_associations", SaveBeforeAssociations(true))
    	createCallback.Register("gorm:create", Create(config))
    	createCallback.Register("gorm:save_after_associations", SaveAfterAssociations(true))
    	createCallback.Register("gorm:after_create", AfterCreate)
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Wed Oct 27 23:56:55 GMT 2021
    - 3.3K bytes
    - Viewed (0)
  7. callbacks/callmethod.go

    package callbacks
    
    import (
    	"reflect"
    
    	"gorm.io/gorm"
    )
    
    func callMethod(db *gorm.DB, fc func(value interface{}, tx *gorm.DB) bool) {
    	tx := db.Session(&gorm.Session{NewDB: true})
    	if called := fc(db.Statement.ReflectValue.Interface(), tx); !called {
    		switch db.Statement.ReflectValue.Kind() {
    		case reflect.Slice, reflect.Array:
    			db.Statement.CurDestIndex = 0
    			for i := 0; i < db.Statement.ReflectValue.Len(); i++ {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 846 bytes
    - Viewed (0)
  8. tests/transaction_test.go

    package tests_test
    
    import (
    	"context"
    	"errors"
    	"testing"
    
    	"gorm.io/gorm"
    	. "gorm.io/gorm/utils/tests"
    )
    
    func TestTransaction(t *testing.T) {
    	tx := DB.Begin()
    	user := *GetUser("transaction", Config{})
    
    	if err := tx.Save(&user).Error; err != nil {
    		t.Fatalf("No error should raise, but got %v", err)
    	}
    
    	if err := tx.First(&User{}, "name = ?", "transaction").Error; err != nil {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  9. schema/field_test.go

    	TypeAlias struct {
    		ID
    		INT     `gorm:"column:fint"`
    		INT8    `gorm:"column:fint8"`
    		INT16   `gorm:"column:fint16"`
    		INT32   `gorm:"column:fint32"`
    		INT64   `gorm:"column:fint64"`
    		UINT    `gorm:"column:fuint"`
    		UINT8   `gorm:"column:fuint8"`
    		UINT16  `gorm:"column:fuint16"`
    		UINT32  `gorm:"column:fuint32"`
    		UINT64  `gorm:"column:fuint64"`
    		FLOAT32 `gorm:"column:ffloat32"`
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Sat Feb 19 09:02:53 GMT 2022
    - 12.7K bytes
    - Viewed (0)
  10. 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"`
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Apr 08 03:29:55 GMT 2024
    - 2.3K bytes
    - Viewed (0)
Back to top