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

Function windowSpecSQL

pkg/sql/ast/sql.go:1342–1357  ·  view source on GitHub ↗
(w *WindowSpec)

Source from the content-addressed store, hash-verified

1340}
1341
1342func windowSpecSQL(w *WindowSpec) string {
1343 var parts []string
1344 if w.Name != "" {
1345 parts = append(parts, w.Name)
1346 }
1347 if len(w.PartitionBy) > 0 {
1348 parts = append(parts, "PARTITION BY "+exprListSQL(w.PartitionBy))
1349 }
1350 if len(w.OrderBy) > 0 {
1351 parts = append(parts, "ORDER BY "+orderBySQL(w.OrderBy))
1352 }
1353 if w.FrameClause != nil {
1354 parts = append(parts, windowFrameSQL(w.FrameClause))
1355 }
1356 return strings.Join(parts, " ")
1357}
1358
1359func windowFrameSQL(f *WindowFrame) string {
1360 if f.End != nil {

Callers 2

SQLMethod · 0.70
SQLMethod · 0.70

Calls 3

exprListSQLFunction · 0.70
orderBySQLFunction · 0.70
windowFrameSQLFunction · 0.70

Tested by

no test coverage detected