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

Function getStatementWithResultLimit

backend/plugin/db/bigquery/bigquery.go:323–329  ·  view source on GitHub ↗
(statement string, limit int)

Source from the content-addressed store, hash-verified

321}
322
323func getStatementWithResultLimit(statement string, limit int) string {
324 limitPart := ""
325 if limit > 0 {
326 limitPart = fmt.Sprintf(" LIMIT %d", limit)
327 }
328 return fmt.Sprintf("WITH result AS (%s) SELECT * FROM result%s;", util.TrimStatement(statement), limitPart)
329}
330
331func convertValue(v bigquery.Value, fieldType bigquery.FieldType) *v1pb.RowValue {
332 if v == nil {

Callers 1

QueryConnMethod · 0.70

Calls 1

TrimStatementFunction · 0.92

Tested by

no test coverage detected