MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / fetchSQL

Function fetchSQL

pkg/sql/ast/sql.go:1366–1386  ·  view source on GitHub ↗
(f *FetchClause)

Source from the content-addressed store, hash-verified

1364}
1365
1366func fetchSQL(f *FetchClause) string {
1367 sb := getBuilder()
1368 defer putBuilder(sb)
1369 if f.OffsetValue != nil {
1370 fmt.Fprintf(sb, " OFFSET %d ROWS", *f.OffsetValue)
1371 }
1372 fmt.Fprintf(sb, " FETCH %s", f.FetchType)
1373 if f.FetchValue != nil {
1374 fmt.Fprintf(sb, " %d", *f.FetchValue)
1375 }
1376 if f.IsPercent {
1377 sb.WriteString(" PERCENT")
1378 }
1379 sb.WriteString(" ROWS")
1380 if f.WithTies {
1381 sb.WriteString(" WITH TIES")
1382 } else {
1383 sb.WriteString(" ONLY")
1384 }
1385 return sb.String()
1386}
1387
1388func forSQL(f *ForClause) string {
1389 sb := getBuilder()

Callers 1

SQLMethod · 0.70

Calls 3

getBuilderFunction · 0.85
putBuilderFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected