Documentation
¶
Index ¶
- func DeclType(t reflect.Type) string
- func MustRegisterClass(source SQSource, proto interface{}) SQClass
- func NewIterator(class *sqclass, rs SQRows) *sqiterator
- func RegisterClass(source SQSource, proto interface{}) (*sqclass, error)
- func ValueOf(v interface{}) reflect.Value
- type SQReflect
- func (this *SQReflect) Column(name string) SQColumn
- func (this *SQReflect) Columns() []SQColumn
- func (this *SQReflect) Index(source SQSource, name string) SQIndexView
- func (this *SQReflect) String() string
- func (this *SQReflect) Table(source SQSource, ifnotexists bool) []SQStatement
- func (this *SQReflect) WithForeignKey(parent SQSource, parentcols ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeclType ¶
DeclType returns the declared column type for a given field uses TEXT by default. Accepts both scalar types and pointer types
func MustRegisterClass ¶
func MustRegisterClass(source SQSource, proto interface{}) SQClass
MustRegisterClass registers a SQObject class, panics if an error occurs.
func NewIterator ¶
func NewIterator(class *sqclass, rs SQRows) *sqiterator
func RegisterClass ¶
func RegisterClass(source SQSource, proto interface{}) (*sqclass, error)
RegisterClass registers a SQObject class, returns the class and any errors
Types ¶
type SQReflect ¶
type SQReflect struct {
// contains filtered or unexported fields
}
func NewReflect ¶
Return a reflection object for the given struct or nil if the argument is not a pointer to a struct or has no fields which are exported
func (*SQReflect) Table ¶
Return table and index definitions for a given source table adding IF NOT EXISTS to the table and indexes
func (*SQReflect) WithForeignKey ¶
WithForeignKey defines a foreign key to a parent class.
Click to show internal directories.
Click to hide internal directories.