// flagsToStatementContext creates a StatementContext from a `tipb.SelectRequest.Flags`.
765511
func flagsToStatementContext(flags uint64) *stmtctx.StatementContext {
	sc := new(stmtctx.StatementContext)
	sc.IgnoreTruncate = (flags & model.FlagIgnoreTruncate) > 0
	sc.TruncateAsWarning = (flags & model.FlagTruncateAsWarning) > 0
	sc.PadCharToFullLength = (flags & model.FlagPadCharToFullLength) > 0
	return sc
}
24127
func (db *DB) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error {
	return SelectContext(ctx, db, dest, query, args...)
}
624086
func (s *GetIntentOutput) SetRejectionStatement(v *Statement) *GetIntentOutput {
	s.RejectionStatement = v
	return s
}
419665
func blockStatementFromDescribe(desc *ast.CallExpr) *ast.BlockStmt {
	var funcLit *ast.FuncLit
	var found = false

	for _, node := range desc.Args {
		switch node := node.(type) {
		case *ast.FuncLit:
			found = true
			funcLit = node
			break
		}
	}

	if !found {
		panic("Error finding ast.FuncLit inside describe statement. Somebody done goofed.")
	}

	return funcLit.Body
}
87767
func (s *Stmt) QueryRowxContext(ctx context.Context, args ...interface{}) *Row {
	qs := &qStmt{s}
	return qs.QueryRowxContext(ctx, "", args...)
}
913272
func (s *PutIntentInput) SetRejectionStatement(v *Statement) *PutIntentInput {
	s.RejectionStatement = v
	return s
}
903073
func ToContext(ctx context.Context, entry *logrus.Entry) context.Context {
	return ctxlogrus.ToContext(ctx, entry)
}
1133861
func (s *CreateIntentVersionOutput) SetRejectionStatement(v *Statement) *CreateIntentVersionOutput {
	s.RejectionStatement = v
	return s
}
844589
func (db *DB) InsertContext(ctx context.Context, list ...interface{}) error {
	return insertObjects(ctx, db, db, getInsert, list, opInsert)
}
1198398
func ToContext(ctx context.Context, logger *zap.Logger) context.Context {
	l := &ctxLogger{
		logger: logger,
	}
	return context.WithValue(ctx, ctxMarkerKey, l)
}
708898
func updateStatement(cfName string, fields []string /*, opts Options*/) (statement string) {
	buf := new(bytes.Buffer)
	buf.WriteString(fmt.Sprintf("UPDATE %s ", cfName))

	/*
		// Apply options
		if opts.TTL != 0 {
			buf.WriteString("USING TTL ")
			buf.WriteString(strconv.FormatFloat(opts.TTL.Seconds(), 'f', 0, 64))
			buf.WriteRune(' ')
		}*/

	buf.WriteString("SET ")
	first := true
	for _, fieldName := range fields {
		if !first {
			buf.WriteString(", ")
		} else {
			first = false
		}
		buf.WriteString(fieldName)
		buf.WriteString(` = ?`)
	}

	return buf.String()
}
390322
func (s *QueryExecution) SetStatementType(v string) *QueryExecution {
	s.StatementType = &v
	return s
}
173319
func NewAssertContext(options ...AssertContextConfigOption) AssertContext {
	expectedString := GenerateRandomString()

	serviceAccountFile := os.Getenv(ServiceAccountFileEnv)
	Expect(serviceAccountFile).ToNot(BeEmpty(),
		fmt.Sprintf(ServiceAccountFileMsg, ServiceAccountFileEnv))

	return AssertContext{
		ExpectedString:     expectedString,
		ContentFile:        MakeContentFile(expectedString),
		GCSFileName:        GenerateRandomString(),
		serviceAccountFile: serviceAccountFile,
		options:            options,
		ctx:                context.Background(),
	}
}
1291154
func newSelectStatement(
	table ReadableTable,
	projections []Projection) SelectStatement {

	return &selectStatementImpl{
		table:          table,
		projections:    projections,
		limit:          -1,
		offset:         -1,
		withSharedLock: false,
		forUpdate:      false,
		distinct:       false,
	}
}
1156748
func (call *IssueLinkTokenCall) WithContext(ctx context.Context) *IssueLinkTokenCall {
	call.ctx = ctx
	return call
}
153311
func LexDialectForStatement(l *Lexer) StateFn {

	l.SkipWhiteSpaces()

	r := l.Peek()

	switch r {
	case '/', '-', '#':
		// ensure we have consumed all initial pre-statement comments
		l.Push("LexDialectForStatement", LexDialectForStatement)
		return LexComment(l)
	default:
		peekWord := strings.ToLower(l.PeekWord())
		for _, stmt := range l.dialect.Statements {
			if l.IsEnd() {
				break
			}

			//u.Warnf("LexDialectForStatement peek=%s  keyword=%v ", peekWord, stmt.Token.String())
			if stmt.MatchesKeyword(peekWord, l) {
				// We aren't actually going to consume anything here, just find
				// the correct statement
				l.statement = stmt
				l.curClause = stmt
				if len(stmt.Clauses) > 0 {
					l.curClause = stmt.Clauses[0]
				}
				//u.Infof("statement: %s  curClause %s", l.statement, l.curClause)
				return LexStatement
			} else if stmt.Token == TokenNil {
				if len(stmt.Clauses) == 1 {
					l.statement = stmt
					l.curClause = stmt
					if len(stmt.Clauses) > 0 {
						l.curClause = stmt.Clauses[0]
					}
					return l.clauseState()
				}
				l.statement = stmt
				l.curClause = stmt
				if len(stmt.Clauses) > 0 {
					l.curClause = stmt.Clauses[0]
				}
				return LexStatement
			}

		}
		return l.errorToken("un recognized keyword token:" + peekWord)

	}
}
206568
func (s *StatusEvent) GetContext() string {
	if s == nil || s.Context == nil {
		return ""
	}
	return *s.Context
}