Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for CurrentTable (0.17 sec)

  1. clause/insert.go

    	if insert.Modifier != "" {
    		builder.WriteString(insert.Modifier)
    		builder.WriteByte(' ')
    	}
    
    	builder.WriteString("INTO ")
    	if insert.Table.Name == "" {
    		builder.WriteQuoted(currentTable)
    	} else {
    		builder.WriteQuoted(insert.Table)
    	}
    }
    
    // MergeClause merge insert clause
    func (insert Insert) MergeClause(clause *Clause) {
    	if v, ok := clause.Expression.(Insert); ok {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 09 09:07:00 GMT 2020
    - 767 bytes
    - Viewed (0)
  2. clause/clause.go

    			c.AfterExpression.Build(builder)
    		}
    	}
    }
    
    const (
    	PrimaryKey   string = "~~~py~~~" // primary key
    	CurrentTable string = "~~~ct~~~" // current table
    	Associations string = "~~~as~~~" // associations
    )
    
    var (
    	currentTable  = Table{Name: CurrentTable}
    	PrimaryColumn = Column{Table: CurrentTable, Name: PrimaryKey}
    )
    
    // Column quote with name
    type Column struct {
    	Table string
    	Name  string
    	Alias string
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Feb 02 09:15:08 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  3. migrator/migrator.go

    		if err := stmt.Parse(oldName); err == nil {
    			oldTable = m.CurrentTable(stmt)
    		} else {
    			return err
    		}
    	}
    
    	if v, ok := newName.(string); ok {
    		newTable = clause.Table{Name: v}
    	} else {
    		stmt := &gorm.Statement{DB: m.DB}
    		if err := stmt.Parse(newName); err == nil {
    			newTable = m.CurrentTable(stmt)
    		} else {
    			return err
    		}
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  4. callbacks/query.go

    					if isRelations {
    						genJoinClause := func(joinType clause.JoinType, parentTableName string, relation *schema.Relationship) clause.Join {
    							tableAliasName := relation.Name
    							if parentTableName != clause.CurrentTable {
    								tableAliasName = utils.NestedRelationName(parentTableName, tableAliasName)
    							}
    
    							columnStmt := gorm.Statement{
    								Table: tableAliasName, DB: db, Schema: relation.FieldSchema,
    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)
  5. finisher_api.go

    func (db *DB) First(dest interface{}, conds ...interface{}) (tx *DB) {
    	tx = db.Limit(1).Order(clause.OrderByColumn{
    		Column: clause.Column{Table: clause.CurrentTable, Name: clause.PrimaryKey},
    	})
    	if len(conds) > 0 {
    		if exprs := tx.Statement.BuildCondition(conds[0], conds[1:]...); len(exprs) > 0 {
    			tx.Statement.AddClause(clause.Where{Exprs: exprs})
    		}
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
  6. clause/from.go

    	if len(from.Tables) > 0 {
    		for idx, table := range from.Tables {
    			if idx > 0 {
    				builder.WriteByte(',')
    			}
    
    			builder.WriteQuoted(table)
    		}
    	} else {
    		builder.WriteQuoted(currentTable)
    	}
    
    	for _, join := range from.Joins {
    		builder.WriteByte(' ')
    		join.Build(builder)
    	}
    }
    
    // MergeClause merge from clause
    func (from From) MergeClause(clause *Clause) {
    	clause.Expression = from
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Jul 15 02:25:10 GMT 2020
    - 630 bytes
    - Viewed (0)
  7. soft_delete.go

    						c.Expression = where
    						stmt.Clauses["WHERE"] = c
    						break
    					}
    				}
    			}
    		}
    
    		stmt.AddClause(clause.Where{Exprs: []clause.Expression{
    			clause.Eq{Column: clause.Column{Table: clause.CurrentTable, Name: sd.Field.DBName}, Value: sd.ZeroValue},
    		}})
    		stmt.Clauses["soft_delete_enabled"] = clause.Clause{}
    	}
    }
    
    func (DeletedAt) UpdateClauses(f *schema.Field) []clause.Interface {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Feb 01 06:40:55 GMT 2023
    - 4.5K bytes
    - Viewed (0)
  8. clause/from_test.go

    						{
    							Type:  clause.RightJoin,
    							Table: clause.Table{Name: "profiles"},
    							ON: clause.Where{
    								[]clause.Expression{clause.Eq{clause.Column{Table: "profiles", Name: "email"}, clause.Column{Table: clause.CurrentTable, Name: "email"}}},
    							},
    						},
    					},
    				}, clause.From{
    					Joins: []clause.Join{
    						{
    							Type:  clause.InnerJoin,
    							Table: clause.Table{Name: "articles"},
    							ON: clause.Where{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Jul 15 02:25:10 GMT 2020
    - 1.9K bytes
    - Viewed (0)
  9. statement.go

    	case clause.Table:
    		if v.Name == clause.CurrentTable {
    			if stmt.TableExpr != nil {
    				stmt.TableExpr.Build(stmt)
    			} else {
    				write(v.Raw, stmt.Table)
    			}
    		} else {
    			write(v.Raw, v.Name)
    		}
    
    		if v.Alias != "" {
    			writer.WriteByte(' ')
    			write(v.Raw, v.Alias)
    		}
    	case clause.Column:
    		if v.Table != "" {
    			if v.Table == clause.CurrentTable {
    				write(v.Raw, stmt.Table)
    			} else {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 19.8K bytes
    - Viewed (0)
  10. callbacks/preload.go

    		if len(joinForeignValues) == 0 {
    			return nil
    		}
    
    		joinResults := rel.JoinTable.MakeSlice().Elem()
    		column, values := schema.ToQueryValues(clause.CurrentTable, joinForeignKeys, joinForeignValues)
    		if err := tx.Where(clause.IN{Column: column, Values: values}).Find(joinResults.Addr().Interface()).Error; err != nil {
    			return err
    		}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 11.6K bytes
    - Viewed (0)
Back to top