- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 40 for utils (0.38 sec)
-
schema/utils.go
package schema import ( "context" "fmt" "reflect" "regexp" "strings" "gorm.io/gorm/clause" "gorm.io/gorm/utils" ) var embeddedCacheKey = "embedded_cache_store" func ParseTagSetting(str string, sep string) map[string]string { settings := map[string]string{} names := strings.Split(str, sep) for i := 0; i < len(names); i++ { j := i if len(names[j]) > 0 { for {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Sat Aug 19 13:35:14 GMT 2023 - 5.5K bytes - Viewed (0) -
utils/utils.go
package utils import ( "database/sql/driver" "fmt" "path/filepath" "reflect" "runtime" "strconv" "strings" "unicode" ) var gormSourceDir string func init() { _, file, _, _ := runtime.Caller(0) // compatible solution to get gorm source directory with various operating systems gormSourceDir = sourceDir(file) } func sourceDir(file string) string { dir := filepath.Dir(file)
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Apr 22 06:43:02 GMT 2024 - 3.8K bytes - Viewed (0) -
utils/utils_test.go
package utils import ( "database/sql" "database/sql/driver" "errors" "math" "strings" "testing" "time" ) func TestIsValidDBNameChar(t *testing.T) { for _, db := range []string{"db", "dbName", "db_name", "db1", "1dbname", "db$name"} { if fields := strings.FieldsFunc(db, IsValidDBNameChar); len(fields) != 1 { t.Fatalf("failed to parse db name %v", db) } } } func TestCheckTruth(t *testing.T) {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Feb 19 03:42:25 GMT 2024 - 3.6K bytes - Viewed (0) -
callbacks.go
c.name = name c.remove = true c.processor.callbacks = append(c.processor.callbacks, c) return c.processor.compile() } func (c *callback) Replace(name string, fn func(*DB)) error { c.processor.db.Logger.Info(context.Background(), "replacing callback `%s` from %s\n", name, utils.FileWithLineNum()) c.name = name c.handler = fn
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Mar 26 03:33:36 GMT 2024 - 8.6K bytes - Viewed (1) -
scan.go
package gorm import ( "database/sql" "database/sql/driver" "reflect" "time" "gorm.io/gorm/schema" "gorm.io/gorm/utils" ) // prepareValues prepare values slice func prepareValues(values []interface{}, db *DB, columnTypes []*sql.ColumnType, columns []string) { if db.Statement.Schema != nil { for idx, name := range columns { if field := db.Statement.Schema.LookUpField(name); field != nil {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Apr 26 09:53:11 GMT 2024 - 9.8K bytes - Viewed (0) -
tests/prepared_stmt_test.go
package tests_test import ( "context" "errors" "sync" "testing" "time" "gorm.io/gorm" . "gorm.io/gorm/utils/tests" ) func TestPreparedStmt(t *testing.T) { tx := DB.Session(&gorm.Session{PrepareStmt: true}) if _, ok := tx.ConnPool.(*gorm.PreparedStmtDB); !ok { t.Fatalf("should assign PreparedStatement Manager back to database when using PrepareStmt mode") }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Mar 21 07:55:43 GMT 2024 - 4K bytes - Viewed (0) -
tests/connpool_test.go
package tests_test import ( "context" "database/sql" "os" "reflect" "testing" "gorm.io/driver/mysql" "gorm.io/gorm" . "gorm.io/gorm/utils/tests" ) type wrapperTx struct { *sql.Tx conn *wrapperConnPool } func (c *wrapperTx) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) { c.conn.got = append(c.conn.got, query) return c.Tx.PrepareContext(ctx, query) }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Feb 06 02:54:40 GMT 2024 - 5.5K bytes - Viewed (0) -
tests/embedded_struct_test.go
package tests_test import ( "database/sql/driver" "encoding/json" "errors" "reflect" "testing" "time" "gorm.io/gorm" . "gorm.io/gorm/utils/tests" ) func TestEmbeddedStruct(t *testing.T) { type ReadOnly struct { ReadOnly *bool } type BasePost struct { Id int64 Title string URL string ReadOnly } type Author struct { ID string Name string
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Oct 26 03:58:13 GMT 2023 - 7.3K bytes - Viewed (0) -
tests/count_test.go
package tests_test import ( "fmt" "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
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Oct 30 09:15:49 GMT 2023 - 6.9K bytes - Viewed (0) -
callbacks/query.go
nestedAlias := utils.NestedRelationName(parentTableName, rel.Name) if _, ok := specifiedRelationsName[nestedAlias]; !ok { fromClause.Joins = append(fromClause.Joins, genJoinClause(join.JoinType, parentTableName, rel)) specifiedRelationsName[nestedAlias] = nil } if parentTableName != clause.CurrentTable { parentTableName = utils.NestedRelationName(parentTableName, rel.Name)
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Jan 29 03:34:57 GMT 2024 - 9.9K bytes - Viewed (0)