Documentation ¶
Index ¶
- type Column
- type Columns
- func (c *Columns) Add(names ...string) []*Column
- func (c Columns) QuotedString(quoter quoter) string
- func (c Columns) QuotedUpdateString(quoter quoter) string
- func (c Columns) Readable() *ReadableColumns
- func (c *Columns) Remove(names ...string)
- func (c Columns) String() string
- func (c Columns) SymbolizedString() string
- func (c Columns) Writeable() *WriteableColumns
- 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) QuotedUpdateString ¶
QuotedUpdateString returns quoted the SQL statement to UPDATE the 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 IDField string // contains filtered or unexported fields }
Columns represent a list of columns, related to a given table.
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) QuotedString ¶
QuotedString gives the columns list quoted with the given quoter function.
func (Columns) QuotedUpdateString ¶
QuotedUpdateString returns the quoted SQL column list part of the UPDATE query.
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.