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

Function orderBySQL

pkg/sql/ast/sql.go:1283–1300  ·  view source on GitHub ↗
(orders []OrderByExpression)

Source from the content-addressed store, hash-verified

1281}
1282
1283func orderBySQL(orders []OrderByExpression) string {
1284 parts := make([]string, len(orders))
1285 for i, o := range orders {
1286 s := exprSQL(o.Expression)
1287 if !o.Ascending {
1288 s += " DESC"
1289 }
1290 if o.NullsFirst != nil {
1291 if *o.NullsFirst {
1292 s += " NULLS FIRST"
1293 } else {
1294 s += " NULLS LAST"
1295 }
1296 }
1297 parts[i] = s
1298 }
1299 return strings.Join(parts, ", ")
1300}
1301
1302func tableRefSQL(t *TableReference) string {
1303 sb := getBuilder()

Callers 4

SQLMethod · 0.70
SQLMethod · 0.70
SQLMethod · 0.70
windowSpecSQLFunction · 0.70

Calls 1

exprSQLFunction · 0.70

Tested by

no test coverage detected