Documentation ¶
Index ¶
- Constants
- func DDLColumn(col *Column) string
- func DDLIndex(col *Column) string
- func DDLUniqueIndex(col *Column) string
- func Describe(db int, schema, model, filter string) e.Json
- func FunctionDef(linq *Linq, col *Column) string
- func GetAs(n int) string
- type Col
- type Column
- func (c *Column) As(linq *Linq) string
- func (c *Column) Cast(cast string) *Column
- func (c *Column) ColName() string
- func (c *Column) DDL() string
- func (c *Column) DDLIndex() string
- func (c *Column) DDLUniqueIndex() string
- func (c *Column) Def(linq *Linq) string
- func (c *Column) Describe() e.Json
- func (c *Column) Driver() string
- func (c *Column) Eq(val any) *Where
- func (c *Column) From(from string) *Column
- func (c *Column) In(vals ...any) *Where
- func (c *Column) Less(val any) *Where
- func (c *Column) LessEq(val any) *Where
- func (c *Column) Like(val any) *Where
- func (c *Column) Low() string
- func (c *Column) More(val any) *Where
- func (c *Column) MoreEq(val any) *Where
- func (c *Column) Name(name string) *Column
- func (c *Column) Neg(val any) *Where
- func (c *Column) Up() string
- func (c *Column) Valid(val any) error
- type Details
- type FRom
- type Join
- type Linq
- func (c *Linq) AddPrimaryKey(col *Column, val any)
- func (c *Linq) AddValidate(col *Column, val any)
- func (s *Linq) All() (e.Items, error)
- func (c *Linq) And(where *Where) *Linq
- func (c *Linq) As(val any) string
- func (c *Linq) Col(val any) *Column
- func (c *Linq) Command() (e.Items, error)
- func (c *Linq) CommandOne() (e.Item, error)
- func (s *Linq) Count() int
- func (c *Linq) Current() (e.Items, error)
- func (s *Linq) Data(sel ...any) *Linq
- func (c *Linq) Debug() *Linq
- func (c *Linq) Details(data *e.Json) *e.Json
- func (s *Linq) Find() (e.Items, error)
- func (s *Linq) First() (e.Item, error)
- func (c *Linq) From(model *Model, as ...string) *Linq
- func (c *Linq) GetAs() string
- func (c *Linq) GetCol(name string) *Column
- func (c *Linq) GetFrom(col *Column) *FRom
- func (c *Linq) GroupBy(cols ...any) *Linq
- func (c *Linq) Join(from, join *FRom, where *Where) *Linq
- func (c *Linq) LeftJoin(from, join *FRom, where *Where) *Linq
- func (s *Linq) Limit(limit int) (e.Items, error)
- func (s *Linq) List(page, rows int) (e.List, error)
- func (c *Linq) Or(where *Where) *Linq
- func (c *Linq) OrderBy(col *Column, sorted bool) *Linq
- func (s *Linq) Page(page, rows int) (e.Items, error)
- func (c *Linq) PrepareDelete() (e.Items, error)
- func (c *Linq) PrepareInsert() error
- func (c *Linq) PrepareUpdate() (e.Items, error)
- func (c *Linq) PrepareUpsert() (e.Items, error)
- func (c *Linq) Query() (e.Items, error)
- func (c *Linq) QueryCount() int
- func (c *Linq) QueryOne() (e.Item, error)
- func (c *Linq) Returns(cols ...any) *Linq
- func (c *Linq) RightJoin(from, join *FRom, where *Where) *Linq
- func (c *Linq) SQL() SQL
- func (s *Linq) Select(sel ...any) *Linq
- func (c *Linq) SetAs(model *Model, as string) string
- func (c *Linq) SetFromAs(from *FRom) *FRom
- func (c *Linq) SetTp(tp int) *Linq
- func (c *Linq) Sql() string
- func (c *Linq) SqlAll() string
- func (c *Linq) SqlColumDef(cols ...*Column) string
- func (c *Linq) SqlColums(cols ...*Column) string
- func (c *Linq) SqlCount() string
- func (c *Linq) SqlCurrent() string
- func (c *Linq) SqlDelete() string
- func (c *Linq) SqlFrom() string
- func (c *Linq) SqlGroupBy() string
- func (c *Linq) SqlIndex() string
- func (c *Linq) SqlInsert() string
- func (c *Linq) SqlJoin() string
- func (c *Linq) SqlKeys() string
- func (c *Linq) SqlLimit(limit int) string
- func (c *Linq) SqlOffset(limit, offset int) string
- func (c *Linq) SqlOrderBy() string
- func (c *Linq) SqlReturn() string
- func (c *Linq) SqlSelect() string
- func (c *Linq) SqlUpdate() string
- func (c *Linq) SqlWhere() string
- func (c *Linq) ToCols(sel ...any) []*Column
- func (c *Linq) Where(where *Where) *Linq
- type Model
- func (c *Model) All() []*Column
- func (c *Model) As(as string) *FRom
- func (c *Model) Atrib(name string) *Column
- func (c *Model) AtribIdx(name string) int
- func (c *Model) Avg(args ...any) *Column
- func (c *Model) Changue(current e.Json, linq *Linq) *Linq
- func (c *Model) Col(name string) *Column
- func (c *Model) ColIdx(name string) int
- func (c *Model) Column(name string) *Column
- func (c *Model) Concat(args ...any) *Column
- func (c *Model) Consolidate(linq *Linq) *Linq
- func (c *Model) Count(args ...any) *Column
- func (c *Model) DDL() string
- func (c *Model) DDLMigration() string
- func (c *Model) Data(sel ...any) *Linq
- func (c *Model) DefineAtrib(name, description, _type string, _default any) *Model
- func (c *Model) DefineColum(name, description, _type string, _default any) *Model
- func (c *Model) DefineField(name, description string, _default any, definition string) *Model
- func (c *Model) DefineForeignKey(thisKey string, otherKey *Column) *Model
- func (c *Model) DefineHidden(hiddens []string) *Model
- func (c *Model) DefineIndex(index []string) *Model
- func (c *Model) DefinePrimaryKey(keys []string) *Model
- func (c *Model) DefineReference(thisKey, name, otherKey string, column *Column) *Model
- func (c *Model) DefineRequired(names []string) *Model
- func (c *Model) DefineUniqueIndex(index []string) *Model
- func (c *Model) Delete() *Linq
- func (c *Model) Describe() e.Json
- func (c *Model) Details(name, description string, _default any, details Details)
- func (c *Model) Driver() string
- func (c *Model) DropDDL() string
- func (c *Model) From() *Linq
- func (c *Model) Init() error
- func (c *Model) Insert(data e.Json) *Linq
- func (c *Model) IntegrityAtrib(ok bool) *Model
- func (c *Model) IntegrityReference(ok bool) *Model
- func (c *Model) Low() string
- func (c *Model) Max(args ...any) *Column
- func (c *Model) Min(args ...any) *Column
- func (c *Model) Model() e.Json
- func (c *Model) Select(sel ...any) *Linq
- func (c *Model) SetUseSync(val bool) *Model
- func (c *Model) Sum(args ...any) *Column
- func (c *Model) TitleIdx(name string) int
- func (c *Model) Trigger(event int, trigger Trigger)
- func (c *Model) Up() string
- func (c *Model) Update(data e.Json) *Linq
- func (c *Model) Upsert(data e.Json) *Linq
- type OrderBy
- type Reference
- type SQL
- type Schema
- type Trigger
- type Validate
- type Where
Constants ¶
View Source
const ActDelete = 5
View Source
const ActInsert = 4
View Source
const ActSelect = 3
View Source
const ActUpdate = 6
View Source
const ActUpsert = 7
View Source
const AfterDelete = 6
View Source
const AfterInsert = 2
View Source
const AfterUpdate = 4
View Source
const BeforeDelete = 5
View Source
const BeforeInsert = 1
View Source
const BeforeUpdate = 3
View Source
const TpAtrib = 1
View Source
const TpClone = 5
View Source
const TpColumn = 0
View Source
const TpData = 2
View Source
const TpDetail = 2
View Source
const TpField = 6
View Source
const TpFunction = 4
View Source
const TpReference = 3
View Source
const TpSelect = 1
Variables ¶
This section is empty.
Functions ¶
func DDLUniqueIndex ¶ added in v0.0.79
func FunctionDef ¶ added in v0.0.8
Types ¶
type Column ¶
type Column struct { Model *Model Tp int Column *Column Title string Description string Type string Default any Atribs []*Column Reference *Reference Definition interface{} Function string Details Details Indexed bool Unique bool Required bool RequiredMsg string PrimaryKey bool ForeignKey bool Hidden bool // contains filtered or unexported fields }
func NewVirtualAtrib ¶
func (*Column) DDLUniqueIndex ¶ added in v0.0.66
type Linq ¶
* * *
func (*Linq) AddPrimaryKey ¶ added in v0.0.88
func (*Linq) AddValidate ¶ added in v0.0.69
func (*Linq) QueryCount ¶
func (*Linq) SqlCurrent ¶
func (*Linq) SqlGroupBy ¶
func (*Linq) SqlOrderBy ¶
type Model ¶
type Model struct { Db int Database *jdb.Db Name string Description string Schema string Table string Definition []*Column PrimaryKeys []string ForeignKey []*Reference Index []string SourceField string DateMakeField string DateUpdateField string IndexField string CodeField string ProjectField string StateField string Ddl string UseState bool UseSource bool UseDateMake bool UseDateUpdate bool UseProject bool UseIndex bool UseSync bool UseRecycle bool BeforeInsert []Trigger AfterInsert []Trigger BeforeUpdate []Trigger AfterUpdate []Trigger BeforeDelete []Trigger AfterDelete []Trigger Version int // contains filtered or unexported fields }
func (*Model) DDLMigration ¶ added in v0.0.29
func (*Model) DefineAtrib ¶
func (*Model) DefineColum ¶
* * *
func (*Model) DefineField ¶
func (*Model) DefineForeignKey ¶
func (*Model) DefineHidden ¶
func (*Model) DefineIndex ¶
func (*Model) DefinePrimaryKey ¶
func (*Model) DefineReference ¶
func (*Model) DefineRequired ¶ added in v0.0.67
func (*Model) DefineUniqueIndex ¶ added in v0.0.66
func (*Model) IntegrityAtrib ¶
func (*Model) IntegrityReference ¶
func (*Model) SetUseSync ¶ added in v0.0.55
type Reference ¶
func NewForeignKey ¶
type Schema ¶
type Schema struct { Db int Database *jdb.Db Name string Description string UseSync bool SourceField string DateMakeField string DateUpdateField string IndexField string CodeField string ProjectField string StateField string Models []*Model }
func (*Schema) SetUseSync ¶ added in v0.0.55
type Where ¶
type Where struct { PrimaryKey *Validate // contains filtered or unexported fields }
func (*Where) SetPrimaryKey ¶ added in v0.0.88
Click to show internal directories.
Click to hide internal directories.