1234567891011121314151617181920 |
- package orm
- // column is a column in a table
- type column struct {
- field
- ref string
- }
- // GetName returns the name. If relation is given, it
- // will return `tbl`.`col` retpr
- func (c column) GetName(r ...*relation) string {
- if len(r) > 0 {
- return "`" + r[0].f.getFieldName() + "`.`" + c.ref + "`"
- }
- return "`" + c.ref + "`"
- }
- // columns is the collection of all columns in a table
- type columns []column
|