MCPcopy Create free account
hub / github.com/bytebase/bytebase / getStatementWithResultLimit

Function getStatementWithResultLimit

backend/plugin/db/mssql/query.go:161–168  ·  view source on GitHub ↗
(statement string, limit int)

Source from the content-addressed store, hash-verified

159}
160
161func getStatementWithResultLimit(statement string, limit int) string {
162 stmt, err := getStatementWithResultLimitInline(statement, limit)
163 if err != nil {
164 slog.Error("fail to add limit clause", slog.String("statement", statement), log.BBError(err))
165 return fmt.Sprintf("WITH result AS (%s) SELECT TOP %d * FROM result;", util.TrimStatement(statement), limit)
166 }
167 return stmt
168}
169
170func getStatementWithResultLimitInline(singleStatement string, limitCount int) (string, error) {
171 return omnimssql.StatementWithResultLimit(singleStatement, limitCount)

Callers 2

queryBatchMethod · 0.70
runLimitTestFunction · 0.70

Calls 5

BBErrorFunction · 0.92
TrimStatementFunction · 0.92
StringMethod · 0.65
ErrorMethod · 0.45

Tested by 1

runLimitTestFunction · 0.56