Documentation ¶
Index ¶
- type Column
- type Columns
- func ColumnsForStruct(s interface{}, tableName string) (columns Columns)deprecated
- func ColumnsForStructWithAlias(s interface{}, tableName string, tableAlias string) (columns Columns)deprecated
- func ForStruct(s interface{}, tableName string) (columns Columns)
- func ForStructWithAlias(s interface{}, tableName string, tableAlias string) (columns Columns)
- func NewColumns(tableName string) Columns
- func NewColumnsWithAlias(tableName string, tableAlias string) Columns
- type ReadableColumns
- type Tag
- type Tags
- type WriteableColumns
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶
Column represents a SQL table column.
func (*Column) SetSelectSQL ¶
SetSelectSQL sets a custom SELECT statement for the column.
func (Column) UpdateString ¶
UpdateString returns the SQL statement to UPDATE the column.
type Columns ¶
type Columns struct { Cols map[string]*Column TableName string TableAlias string // contains filtered or unexported fields }
Columns represent a list of columns, related to a given table.
func ColumnsForStruct
deprecated
func ColumnsForStructWithAlias
deprecated
func ForStructWithAlias ¶
ForStructWithAlias returns a Columns instance for the struct passed in. If the tableAlias is not empty, it will be used.
func NewColumns ¶
NewColumns constructs a list of columns for a given table name.
func NewColumnsWithAlias ¶
NewColumnsWithAlias constructs a list of columns for a given table name, using a given alias for the table.
func (Columns) Readable ¶
func (c Columns) Readable() *ReadableColumns
Readable gets a list of the readable columns from the column list.
func (Columns) SymbolizedString ¶
SymbolizedString returns a list of tokens (:token) to bind a value to an INSERT query.
func (Columns) Writeable ¶
func (c Columns) Writeable() *WriteableColumns
Writeable gets a list of the writeable columns from the column list.
type ReadableColumns ¶
type ReadableColumns struct {
Columns
}
ReadableColumns represents a list of columns Pop is allowed to read.
func (ReadableColumns) SelectString ¶
func (c ReadableColumns) SelectString() string
SelectString returns the SQL column list part of the SELECT query.
type Tags ¶
type Tags []Tag
Tags is a group of pop tags defined in just one model field.
func TagsFor ¶
func TagsFor(field reflect.StructField) Tags
TagsFor is a function which returns all tags defined in model field.
type WriteableColumns ¶
type WriteableColumns struct {
Columns
}
WriteableColumns represents a list of columns Pop is allowed to write.
func (WriteableColumns) UpdateString ¶
func (c WriteableColumns) UpdateString() string
UpdateString returns the SQL column list part of the UPDATE query.