Add RETURNING to Delete statement.
Add DELETE statement wiki page.
This commit is contained in:
parent
3d38946eda
commit
5e0e2f2908
10 changed files with 189 additions and 37 deletions
12
clause.go
12
clause.go
|
|
@ -124,6 +124,18 @@ func (q *queryData) writeHaving(statement statementType, having Expression) erro
|
|||
return err
|
||||
}
|
||||
|
||||
func (q *queryData) writeReturning(statement statementType, returning []projection) error {
|
||||
if len(returning) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
q.newLine()
|
||||
q.writeString("RETURNING")
|
||||
q.increaseIdent()
|
||||
|
||||
return q.writeProjections(statement, returning)
|
||||
}
|
||||
|
||||
func (q *queryData) newLine() {
|
||||
q.write([]byte{'\n'})
|
||||
q.write(bytes.Repeat([]byte{' '}, q.ident))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue