MCPcopy
hub / github.com/sqldef/sqldef / Format

Method Format

parser/node.go:950–969  ·  view source on GitHub ↗

Format formats the node.

(buf *nodeBuffer)

Source from the content-addressed store, hash-verified

948
949// Format formats the node.
950func (ed *ExclusionDefinition) Format(buf *nodeBuffer) {
951 if !ed.ConstraintName.IsEmpty() {
952 buf.Printf("constraint %v ", ed.ConstraintName)
953 }
954 buf.Printf("exclude")
955 if !ed.IndexType.IsEmpty() {
956 buf.Printf(" using %v", ed.IndexType)
957 }
958 buf.Printf(" (")
959 for i, ex := range ed.Exclusions {
960 if i > 0 {
961 buf.Printf(", ")
962 }
963 buf.Printf("%v with %s", ex.Expression, ex.Operator)
964 }
965 buf.Printf(")")
966 if ed.Where != nil && ed.Where.Expr != nil {
967 buf.Printf(" where (%v)", ed.Where.Expr)
968 }
969}
970
971// Format returns a canonical string representation of the type and all relevant options
972func (ct *ColumnType) Format(buf *nodeBuffer) {

Callers

nothing calls this directly

Calls 2

PrintfMethod · 0.65
IsEmptyMethod · 0.45

Tested by

no test coverage detected