Documentation
¶
Index ¶
- type Boolean
- type Bytes
- type Column
- type DataType
- type DateTime
- type Enum
- type EnumValue
- type Enumerable
- type Filter
- type FilterField
- func (f *FilterField) Camel() string
- func (f *FilterField) Coerce(value string) (string, error)
- func (f *FilterField) Description() string
- func (f *FilterField) Format() string
- func (f *FilterField) Name() string
- func (f *FilterField) NullFormat() string
- func (f *FilterField) Nullable() bool
- func (f *FilterField) Pascal() string
- func (f *FilterField) Spread() string
- func (f *FilterField) Type() string
- type Float32
- type Float64
- type ForeignKey
- type Index
- func (i *Index) ColumnList() string
- func (i *Index) Columns() []*IndexColumn
- func (i *Index) Description() string
- func (i *Index) IsPrimary() bool
- func (i *Index) IsUnique() bool
- func (i *Index) Method() string
- func (i *Index) Params() (string, error)
- func (i *Index) Variables() string
- func (i *Index) Where() string
- type IndexColumn
- type Int
- type Int64
- type JSON
- type List
- type Null
- type OrderField
- type PrimaryKey
- type Procedure
- type ProcedureParam
- type Schema
- type String
- type Table
- func (t *Table) Camel() string
- func (t *Table) Columns() []*Column
- func (t *Table) Filters() (filters []*Filter)
- func (t *Table) Indexes() []*Index
- func (t *Table) Orders() (orders []*OrderField)
- func (t *Table) Pascal() string
- func (t *Table) PluralCamel() string
- func (t *Table) PrimaryKey() *PrimaryKey
- func (t *Table) Returning() string
- func (t *Table) SQLName() string
- func (t *Table) Scan() string
- func (t *Table) Select() string
- func (t *Table) Short() string
- func (t *Table) Slug() string
- func (t *Table) Uniques() (uniques []*Index)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct {
// contains filtered or unexported fields
}
Column struct
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter struct
func (*Filter) Fields ¶
func (f *Filter) Fields() (fields []*FilterField, err error)
Fields gets the filter fields based on the type
type FilterField ¶
type FilterField struct {
// contains filtered or unexported fields
}
FilterField struct
func (*FilterField) Coerce ¶
func (f *FilterField) Coerce(value string) (string, error)
Coerce the value of the filter field
func (*FilterField) Description ¶
func (f *FilterField) Description() string
Description of the field
type ForeignKey ¶
type ForeignKey struct {
// contains filtered or unexported fields
}
ForeignKey struct
func NewForeignKey ¶
func NewForeignKey( name string, dataType DataType, ) *ForeignKey
NewForeignKey fn
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index data
func NewIndex ¶
func NewIndex( name string, isUnique bool, isPrimary bool, paramPrefix string, columns []*IndexColumn, ) *Index
NewIndex fn
func (*Index) ColumnList ¶
ColumnList is string-friendly the list of the columns
type IndexColumn ¶
type IndexColumn struct {
// contains filtered or unexported fields
}
IndexColumn represents index column info.
func NewIndexColumn ¶
func NewIndexColumn( name string, dataType DataType, ) *IndexColumn
NewIndexColumn fn
type OrderField ¶
type OrderField struct {
// contains filtered or unexported fields
}
OrderField struct
type PrimaryKey ¶
type PrimaryKey struct {
// contains filtered or unexported fields
}
PrimaryKey struct
func NewPrimaryKey ¶
func NewPrimaryKey( columns []*Column, paramPrefix string, ) *PrimaryKey
NewPrimaryKey fn
func (*PrimaryKey) ColumnList ¶
func (pk *PrimaryKey) ColumnList() string
ColumnList is string-friendly the list of the columns
type Procedure ¶
type Procedure struct {
Name string // proc name
Params []*ProcedureParam
ReturnType string // return type
}
Procedure represents a stored procedure.
type ProcedureParam ¶
ProcedureParam represents a stored procedure.
type Schema ¶
type Schema struct {
Provider string
Name string
Tables []*Table
Enums []*Enum
Procedures []*Procedure
}
Schema struct is a universal database structure for storing different types of database schemas
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table struct
func NewTable ¶
func NewTable( schema string, name string, columns []*Column, pk *PrimaryKey, fks []*ForeignKey, idxs []*Index, ) *Table
NewTable fn
func (*Table) PluralCamel ¶
PluralCamel generates the camel case