jet/postgres/clauses.go
go-jet 486e45db5c SQL Builder panics on invalid SQL.
Query execution panics on invalid destination.
2019-08-13 13:57:26 +02:00

20 lines
386 B
Go

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) {
if len(r.Projections) == 0 {
return
}
out.NewLine()
out.WriteString("RETURNING")
out.IncreaseIdent()
out.WriteProjections(statementType, r.Projections)
}