Skip to content

Commit baa3920

Browse files
author
Bar Weiss
committed
Add some in-code documentation
1 parent a7c1eeb commit baa3920

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

select.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,10 @@ func (sb *SelectBuilder) BuildWithFlavor(flavor Flavor, initialArg ...interface{
468468
buf.WriteString(sb.offsetVar)
469469
}
470470
case Presto:
471+
// There might be a hidden constraint in Presto requiring offset to be set before limit.
472+
// The select statement documentation (https://prestodb.io/docs/current/sql/select.html)
473+
// puts offset before limit, and Trino, which is based on Presto, seems
474+
// to require this specific order.
471475
if len(sb.offsetVar) > 0 {
472476
buf.WriteLeadingString("OFFSET ")
473477
buf.WriteString(sb.offsetVar)

0 commit comments

Comments
 (0)