// AddCreatable adds a new Creatable to the table
353123
func (table *TableElem) AddCreatable(c Creatable) {
	table.creates = append(table.creates, c)
}
1182911
func (s *Job) SetCreated(v time.Time) *Job {
	s.Created = &v
	return s
}
1360574
func (s *RemoteAccessSession) SetCreated(v time.Time) *RemoteAccessSession {
	s.Created = &v
	return s
}
584121
func (s *ConfigRule) SetCreatedBy(v string) *ConfigRule {
	s.CreatedBy = &v
	return s
}
382700
func (db *Database) buildCreate() string {
	var query bytes.Buffer
	query.WriteString(db.buildCTE())
	query.WriteString("INSERT INTO ")

	// Model only
	if len(db.tables) != 1 {
		db.panicLog(fmt.Sprintf("Unable to infer table name for Create. Number of tables: %d", len(db.tables)))
	}
	// Table (
	query.WriteString(db.tables[0])
	query.WriteString("(")

	// field1,file2,...
	createSize := len(db.updateCreateFields)
	if createSize == 0 {
		db.panicLog("Unable to detect fields for Create")
	}

	query.WriteString(strings.Join(db.updateCreateFields, ","))
	// values($1,..$n) place holders
	query.WriteString(") VALUES (")
	for i := 0; i < createSize; i++ {
		query.WriteString("$")
		query.WriteString(strconv.Itoa(db.varCount))
		db.varCount++
		if i != createSize-1 {
			query.WriteString(",")
		}
	}

	query.WriteString(") ")
	query.WriteString(db.buildReturning())
	query.WriteString(";")

	qs := query.String()
	db.printLog(qs)
	return qs
}
1253832
func (g *Generator) AddProcessCapabilityInheritable(c string) error {
	cp := strings.ToUpper(c)
	if err := validate.CapValid(cp, g.HostSpecific); err != nil {
		return err
	}

	g.initConfigProcessCapabilities()

	var foundInheritable bool
	for _, cap := range g.Config.Process.Capabilities.Inheritable {
		if strings.ToUpper(cap) == cp {
			foundInheritable = true
			break
		}
	}
	if !foundInheritable {
		g.Config.Process.Capabilities.Inheritable = append(g.Config.Process.Capabilities.Inheritable, cp)
	}

	return nil
}
51548
func (s *Workteam) SetCreateDate(v time.Time) *Workteam {
	s.CreateDate = &v
	return s
}
262788
func (p *Parser) parseCreateTable(ctx *parseCtx) (model.Table, error) {
	if t := ctx.next(); t.Type != TABLE {
		return nil, errors.New(`expected TABLE`)
	}

	var table model.Table

	ctx.skipWhiteSpaces()
	var temporary bool
	if t := ctx.peek(); t.Type == TEMPORARY {
		ctx.advance()
		ctx.skipWhiteSpaces()
		temporary = true
	}

	// IF NOT EXISTS
	var notexists bool
	if ctx.peek().Type == IF {
		ctx.advance()
		if _, err := p.parseIdents(ctx, NOT, EXISTS); err != nil {
			return nil, err
		}
		ctx.skipWhiteSpaces()
		notexists = true
	}

	switch t := ctx.next(); t.Type {
	case IDENT, BACKTICK_IDENT:
		table = model.NewTable(t.Value)
	default:
		return nil, newParseError(ctx, t, "expected IDENT or BACKTICK_IDENT")
	}
	table.SetTemporary(temporary)
	table.SetIfNotExists(notexists)

	ctx.skipWhiteSpaces()
	switch t := ctx.peek(); t.Type {
	case LIKE:
		// CREATE TABLE foo LIKE bar
		ctx.advance()
		ctx.skipWhiteSpaces()
		switch t := ctx.next(); t.Type {
		case IDENT, BACKTICK_IDENT:
			table.SetLikeTable(t.Value)
		default:
			return nil, newParseError(ctx, t, "expected table name after LIKE")
		}

		ctx.skipWhiteSpaces()
		switch t := ctx.peek(); t.Type {
		case EOF, SEMICOLON:
			ctx.advance()
		}
		return table, nil
	case IF:
		ctx.advance()
		if _, err := p.parseIdents(ctx, NOT, EXISTS); err != nil {
			return nil, newParseError(ctx, t, "should NOT EXISTS")
		}
		ctx.skipWhiteSpaces()
		table.SetIfNotExists(true)
	}

	if t := ctx.next(); t.Type != LPAREN {
		return nil, newParseError(ctx, t, "expected LPAREN")
	}

	if err := p.parseCreateTableFields(ctx, table); err != nil {
		return nil, err
	}

	table, _ = table.Normalize()
	return table, nil
}
815076
func (c *CustomResourceProvisioner) add(resourceName string, p customresources.Provisioner) {
	// Wrap the provisioner with timeouts.
	p = customresources.WithTimeout(p, ProvisioningTimeout, ProvisioningGraceTimeout)
	c.Provisioners[resourceName] = withMetrics(p)
}
191013
func (st *symtab) AddVSchemaTable(alias sqlparser.TableName, vschemaTables []*vindexes.Table, rb *route) (vindexMaps []map[*column]vindexes.Vindex, err error) {
	t := &table{
		alias:  alias,
		origin: rb,
	}

	vindexMaps = make([]map[*column]vindexes.Vindex, len(vschemaTables))
	for i, vst := range vschemaTables {
		// If any input is authoritative, we make the table authoritative.
		// TODO(sougou): vschema builder should validate that authoritative columns match.
		if vst.ColumnListAuthoritative {
			t.isAuthoritative = true
		}

		for _, col := range vst.Columns {
			t.addColumn(col.Name, &column{
				origin: rb,
				st:     st,
				typ:    col.Type,
			})
		}

		var vindexMap map[*column]vindexes.Vindex
		for _, cv := range vst.ColumnVindexes {
			for i, cvcol := range cv.Columns {
				col, ok := t.columns[cvcol.Lowered()]
				if !ok {
					col = &column{
						origin: rb,
						st:     st,
					}
					t.addColumn(cvcol, col)
				}
				if i == 0 {
					// For now, only the first column is used for vindex Map functions.
					if vindexMap == nil {
						vindexMap = make(map[*column]vindexes.Vindex)
					}
					vindexMap[col] = cv.Vindex
				}
			}
		}
		vindexMaps[i] = vindexMap

		if ai := vst.AutoIncrement; ai != nil {
			if _, ok := t.columns[ai.Column.Lowered()]; !ok {
				t.addColumn(ai.Column, &column{
					origin: rb,
					st:     st,
				})
			}
		}

	}
	if err := st.AddTable(t); err != nil {
		return nil, err
	}
	return vindexMaps, nil
}
296557
func (s *CrawlerMetrics) SetTablesCreated(v int64) *CrawlerMetrics {
	s.TablesCreated = &v
	return s
}
858167
func (s *DescribeBackupJobOutput) SetCreatedBy(v *RecoveryPointCreator) *DescribeBackupJobOutput {
	s.CreatedBy = v
	return s
}
1172276
func (s *Namespace) SetCreateDate(v time.Time) *Namespace {
	s.CreateDate = &v
	return s
}
753148
func (s *ConfigurationRevision) SetCreated(v time.Time) *ConfigurationRevision {
	s.Created = &v
	return s
}
1048781
func (g *generators) add(cb starlark.Callable) error {
	if g.runningNow {
		return fmt.Errorf("can't add a generator while already running them")
	}
	g.gen = append(g.gen, cb)
	return nil
}
590084
func NewEnableTable(ctx context.Context, table []byte) *EnableTable {
	return &EnableTable{
		base{
			table:    table,
			ctx:      ctx,
			resultch: make(chan RPCResult, 1),
		},
	}
}
790316
func (s *ElasticsearchDomainStatus) SetCreated(v bool) *ElasticsearchDomainStatus {
	s.Created = &v
	return s
}