- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 14 for Muto (0.39 sec)
-
tests/postgres_test.go
for _, column := range columns { if column.Name() == "log_id" { hasLogID = true autoIncrement, ok := column.AutoIncrement() if !ok || !autoIncrement { t.Fatalf("column log_id should be auto incrementment") } } } if !hasLogID { t.Fatalf("failed to found column log_id") } } type Post struct {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Sat Oct 08 09:16:32 GMT 2022 - 6.4K bytes - Viewed (3) -
migrator/migrator.go
execTx = queryTx if m.DB.DryRun { queryTx.DryRun = false execTx = m.DB.Session(&gorm.Session{Logger: &printSQLLogger{Interface: m.DB.Logger}}) } return queryTx, execTx } // AutoMigrate auto migrate values func (m Migrator) AutoMigrate(values ...interface{}) error { for _, value := range m.ReorderModels(values, true) { queryTx, execTx := m.GetQueryAndExecTx() if !queryTx.Migrator().HasTable(value) {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Fri Apr 26 07:15:49 GMT 2024 - 29K bytes - Viewed (0) -
tests/multi_primary_keys_test.go
} if name := DB.Dialector.Name(); name == "postgres" { t.Skip("skip postgres due to it only allow unique constraint matching given keys") } DB.Migrator().DropTable(&Blog{}, &Tag{}, "blog_tags", "locale_blog_tags", "shared_blog_tags") if err := DB.AutoMigrate(&Blog{}, &Tag{}); err != nil { t.Fatalf("Failed to auto migrate, got error: %v", err) }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Thu Jan 06 07:02:53 GMT 2022 - 12.8K bytes - Viewed (0) -
README.md
* 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 * Extendable, flexible plugin API: Database Resolver (Multiple Databases, Read/Write Splitting) / Prometheus… * Every feature comes with tests * Developer Friendly ## Getting Started
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) -
tests/migrate_test.go
if err := DB.AutoMigrate(&MigrateInt{}); err != nil { t.Fatalf("Failed to auto migrate: error: %v", err) } // make new session to set custom logger tracer session := DB.Session(&gorm.Session{Logger: tracer}) // The second AutoMigrate to catch an error if err := session.AutoMigrate(&MigrateInt{}); err != nil { t.Fatalf("Failed to auto migrate: error: %v", err) } }
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) -
migrator.go
tx := db.getInstance() // apply scopes to migrator for len(tx.Statement.scopes) > 0 { tx = tx.executeScopes() } return tx.Dialector.Migrator(tx.Session(&Session{})) } // AutoMigrate run auto migration for given models func (db *DB) AutoMigrate(dst ...interface{}) error { return db.Migrator().AutoMigrate(dst...) } // ViewOption view option type ViewOption struct {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Mon Oct 30 09:15:49 GMT 2023 - 3.1K bytes - Viewed (0) -
migrator/column_type.go
// PrimaryKey returns the column is primary key or not. func (ct ColumnType) PrimaryKey() (isPrimaryKey bool, ok bool) { return ct.PrimaryKeyValue.Bool, ct.PrimaryKeyValue.Valid } // AutoIncrement returns the column is auto increment or not. func (ct ColumnType) AutoIncrement() (isAutoIncrement bool, ok bool) { return ct.AutoIncrementValue.Bool, ct.AutoIncrementValue.Valid }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Thu Mar 24 01:31:58 GMT 2022 - 3.3K bytes - Viewed (0) -
callbacks/create.go
} pkField = db.Statement.Schema.PrioritizedPrimaryField pkFieldName = db.Statement.Schema.PrioritizedPrimaryField.DBName } // append @id column with value for auto-increment primary key // the @id value is correct, when: 1. without setting auto-increment primary key, 2. database AutoIncrementIncrement = 1 switch values := db.Statement.Dest.(type) { case map[string]interface{}: values[pkFieldName] = insertID
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Mon Apr 08 03:29:55 GMT 2024 - 12.5K bytes - Viewed (0) -
tests/preload_suits_test.go
} func TestManyToManyPreloadWithMultiPrimaryKeys(t *testing.T) { if name := DB.Dialector.Name(); name == "sqlite" || name == "sqlserver" { t.Skip("skip sqlite, sqlserver due to it doesn't support multiple primary keys with auto increment") } type ( Level1 struct { ID uint `gorm:"primary_key;"` LanguageCode string `gorm:"primary_key"` Value string } Level2 struct {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Fri Mar 18 05:38:46 GMT 2022 - 30.3K bytes - Viewed (0) -
tests/tests_test.go
if err = DB.Migrator().DropTable(allModels...); err != nil { log.Printf("Failed to drop table, got error %v\n", err) os.Exit(1) } if err = DB.AutoMigrate(allModels...); err != nil { log.Printf("Failed to auto migrate, but got error %v\n", err) os.Exit(1) } for _, m := range allModels { if !DB.Migrator().HasTable(m) { log.Printf("Failed to create table for %#v\n", m) os.Exit(1) } }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Fri Dec 15 08:36:08 GMT 2023 - 3.3K bytes - Viewed (1)