MCPcopy
hub / github.com/go-gorm/gorm / ParseWithSpecialTableName

Method ParseWithSpecialTableName

statement.go:516–527  ·  view source on GitHub ↗
(value interface{}, specialTableName string)

Source from the content-addressed store, hash-verified

514}
515
516func (stmt *Statement) ParseWithSpecialTableName(value interface{}, specialTableName string) (err error) {
517 if stmt.Schema, err = schema.ParseWithSpecialTableName(value, stmt.DB.cacheStore, stmt.DB.NamingStrategy, specialTableName); err == nil && stmt.Table == "" {
518 if tables := strings.Split(stmt.Schema.Table, "."); len(tables) == 2 {
519 stmt.TableExpr = &clause.Expr{SQL: stmt.Quote(stmt.Schema.Table)}
520 stmt.Table = tables[1]
521 return
522 }
523
524 stmt.Table = stmt.Schema.Table
525 }
526 return err
527}
528
529func (stmt *Statement) clone() *Statement {
530 newStmt := &Statement{

Callers 3

ParseMethod · 0.95
RunWithValueMethod · 0.95
ReorderModelsMethod · 0.80

Calls 2

QuoteMethod · 0.95

Tested by

no test coverage detected