(list []*nodes.Node)
| 65 | } |
| 66 | |
| 67 | func parseRelationFromNodes(list []*nodes.Node) (*relation, error) { |
| 68 | parts := stringSliceFromNodes(list) |
| 69 | switch len(parts) { |
| 70 | case 1: |
| 71 | return &relation{ |
| 72 | Name: parts[0], |
| 73 | }, nil |
| 74 | case 2: |
| 75 | return &relation{ |
| 76 | Schema: parts[0], |
| 77 | Name: parts[1], |
| 78 | }, nil |
| 79 | case 3: |
| 80 | return &relation{ |
| 81 | Catalog: parts[0], |
| 82 | Schema: parts[1], |
| 83 | Name: parts[2], |
| 84 | }, nil |
| 85 | default: |
| 86 | return nil, fmt.Errorf("invalid name: %s", joinNodes(list, ".")) |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | func parseRelationFromRangeVar(rv *nodes.RangeVar) *relation { |
| 91 | return &relation{ |
no test coverage detected