jet/postgres/clauses.go

21 lines
386 B
Go
Raw Normal View History

2019-08-11 14:29:03 +02:00
package postgres
import (
"github.com/go-jet/jet/internal/jet"
)
type ClauseReturning struct {
Projections []jet.Projection
}
func (r *ClauseReturning) Serialize(statementType jet.StatementType, out *jet.SqlBuilder) {
2019-08-11 14:29:03 +02:00
if len(r.Projections) == 0 {
return
2019-08-11 14:29:03 +02:00
}
out.NewLine()
out.WriteString("RETURNING")
out.IncreaseIdent()
out.WriteProjections(statementType, r.Projections)
2019-08-11 14:29:03 +02:00
}