TableName returns the name of the selected table or alias of selector.
()
| 2040 | |
| 2041 | // TableName returns the name of the selected table or alias of selector. |
| 2042 | func (s *Selector) TableName() string { |
| 2043 | switch view := s.from[0].(type) { |
| 2044 | case *SelectTable: |
| 2045 | return view.name |
| 2046 | case *Selector: |
| 2047 | return view.as |
| 2048 | default: |
| 2049 | panic(fmt.Sprintf("unhandled TableView type %T", s.from)) |
| 2050 | } |
| 2051 | } |
| 2052 | |
| 2053 | // HasJoins reports if the selector has any JOINs. |
| 2054 | func (s *Selector) HasJoins() bool { |