Some checks failed
kotlin / test (push) Has been skipped
python / test (push) Has been skipped
typescript / test (push) Has been skipped
go / build darwin/amd64 (push) Has been cancelled
go / build linux/amd64 (push) Has been cancelled
go / build windows/amd64 (push) Has been cancelled
go / build darwin/arm64 (push) Has been cancelled
go / build linux/arm64 (push) Has been cancelled
go / build windows/arm64 (push) Has been cancelled
go / test (push) Has been cancelled
go / vuln_check (push) Has been cancelled
34 lines
737 B
Go
34 lines
737 B
Go
package ast
|
|
|
|
import "github.com/sqlc-dev/sqlc/internal/sql/format"
|
|
|
|
type RowExpr struct {
|
|
Tag NodeTag[RowExpr] `json:"tag"`
|
|
|
|
Xpr Node `json:"xpr,omitempty"`
|
|
Args *List `json:"args,omitempty"`
|
|
RowTypeid Oid `json:"row_typeid"`
|
|
RowFormat CoercionForm `json:"row_format"`
|
|
Colnames *List `json:"colnames,omitempty"`
|
|
Location int `json:"location"`
|
|
}
|
|
|
|
func (n *RowExpr) Pos() int {
|
|
return n.Location
|
|
}
|
|
|
|
func (n *RowExpr) Format(buf *TrackedBuffer, d format.Dialect) {
|
|
if n == nil {
|
|
return
|
|
}
|
|
if items(n.Args) {
|
|
buf.WriteString("args")
|
|
buf.astFormat(n.Args, d)
|
|
}
|
|
buf.astFormat(n.Xpr, d)
|
|
if items(n.Colnames) {
|
|
buf.WriteString("cols")
|
|
buf.astFormat(n.Colnames, d)
|
|
}
|
|
}
|