Documentation
¶
Index ¶
- Constants
- Variables
- func Commands(params et.Json) (interface{}, error)
- func Describe(name string) (et.Json, error)
- func EventDeleteDefault(model *Model, before et.Json, after et.Json) error
- func EventErrorDefault(model *Model, err et.Json)
- func EventHistoryDefault(model *Model, before et.Json, after et.Json) error
- func EventInsertDefault(model *Model, before et.Json, after et.Json) error
- func EventUpdateDefault(model *Model, before et.Json, after et.Json) error
- func Name(name string) string
- func NewVmj(model *Model) *goja.Runtime
- func OperatorToCommand(op Operator) string
- func Query(params et.Json) (interface{}, error)
- func Register(name string, driver func() Driver)
- func RowsToItem(rows *sql.Rows) et.Item
- func RowsToItems(rows *sql.Rows) et.Items
- func SQLDDL(sql string, args ...any) string
- func SQLParse(sql string, args ...any) string
- func SQLQuote(sql string) string
- func SourceToItem(source string, rows *sql.Rows) et.Item
- func SourceToItems(source string, rows *sql.Rows) et.Items
- func TableName(schema *Schema, name string) string
- type Adapter
- type Agregation
- type Column
- type ColumnField
- type Command
- func (s *Command) And(val string) *Command
- func (s *Command) Between(vals interface{}) *Command
- func (s *Command) Debug() *Command
- func (s *Command) Describe() et.Json
- func (s *Command) Eq(val interface{}) *Command
- func (s *Command) Exec() (et.Items, error)
- func (s *Command) History(v bool) *Command
- func (s *Command) In(val ...any) *Command
- func (s *Command) IsNull() *Command
- func (s *Command) Less(val interface{}) *Command
- func (s *Command) LessEq(val interface{}) *Command
- func (s *Command) Like(val interface{}) *Command
- func (s *Command) More(val interface{}) *Command
- func (s *Command) MoreEq(val interface{}) *Command
- func (s *Command) Neg(val interface{}) *Command
- func (s *Command) NotNull() *Command
- func (s *Command) One() (et.Item, error)
- func (s *Command) Or(val string) *Command
- func (s *Command) Rollback() error
- func (s *Command) Search(language string, val interface{}) *Command
- func (s *Command) Where(val string) *Command
- type Concat
- type ConnectParams
- type Connector
- type Context
- type DB
- func (s *DB) ChangePassword(username, password, confirmation string) error
- func (s *DB) Command(command *Command) (et.Items, error)
- func (s *DB) Conected(params et.Json) error
- func (s *DB) Count(ql *Ql) (int, error)
- func (s *DB) CreateCore() error
- func (s *DB) CreateModel(model *Model) error
- func (s *DB) CreateSchema(name string) error
- func (s *DB) CreateUser(username, password, confirmation string) error
- func (s *DB) CurrentSerie(tag string) int64
- func (s *DB) Data(source, sql string, params ...any) (et.Items, error)
- func (s *DB) DeleteUser(username string) error
- func (s *DB) Describe() et.Json
- func (s *DB) Disconected() error
- func (s *DB) DropModel(model *Model) error
- func (s *DB) DropSchema(name string) error
- func (s *DB) Exec(sql string, params ...any) error
- func (s *DB) Exists(ql *Ql) (bool, error)
- func (s *DB) GenId(tag string) string
- func (s *DB) GetSerie(tag string) int64
- func (s *DB) GrantPrivileges(username, database string) error
- func (s *DB) LoadTable(model *Model) (bool, error)
- func (s *DB) NextCode(tag, format string) string
- func (s *DB) One(sql string, params ...any) (et.Item, error)
- func (s *DB) Query(sql string, params ...any) (et.Items, error)
- func (s *DB) SaveModel(model *Model) error
- func (s *DB) Select(ql *Ql) (et.Items, error)
- func (s *DB) SetMain(params et.Json) error
- func (s *DB) SetSerie(tag string, val int) int64
- type Driver
- type Event
- type EventError
- type Field
- type Flow
- type FullText
- type Function
- type GeneratedFunction
- type HandlerListener
- type Index
- type JDB
- type Message
- type Mode
- type Model
- func (s *Model) Bulk(data []et.Json) *Command
- func (s *Model) Debug() *Model
- func (s *Model) DefineAtribute(name string, typeData TypeData) *Column
- func (s *Model) DefineColumn(name string, typeData TypeData) *Column
- func (s *Model) DefineColumnIdx(name string, typeData TypeData, idx int) *Column
- func (s *Model) DefineCreatedAtField() *Column
- func (s *Model) DefineDetail(name, fkn string, limit int) *Model
- func (s *Model) DefineEvent(tp TypeEvent, event Event)
- func (s *Model) DefineEventError(event EventError)
- func (s *Model) DefineForeignKey(name string, with *Model) *Column
- func (s *Model) DefineFullText(language string, fields []string) *Column
- func (s *Model) DefineGenerated(name string, fn GeneratedFunction) *Column
- func (s *Model) DefineHidden(colums ...string) *Model
- func (s *Model) DefineHistory(limit int) *Model
- func (s *Model) DefineIndex(sort bool, colums ...string) *Model
- func (s *Model) DefineIndexField() *Column
- func (s *Model) DefineModel() *Model
- func (s *Model) DefinePrimaryKey(name string) *Column
- func (s *Model) DefinePrimaryKeyField() *Column
- func (s *Model) DefineProjectField() *Column
- func (s *Model) DefineProjectModel() *Model
- func (s *Model) DefineRelation(name, relatedTo, fkn string, limit int) *Relation
- func (s *Model) DefineRequired(requireds ...string) *Model
- func (s *Model) DefineRollup(name, rollupFrom, fkn string, properties []string) *Model
- func (s *Model) DefineSource(name string) *Column
- func (s *Model) DefineSourceField() *Column
- func (s *Model) DefineStateField() *Column
- func (s *Model) DefineSystemKeyField() *Column
- func (s *Model) DefineUnique(colums ...string) *Model
- func (s *Model) DefineUpdatedAtField() *Column
- func (s *Model) Delete() *Command
- func (s *Model) Describe() et.Json
- func (s *Model) Drop()
- func (s *Model) GenId(id string) string
- func (s *Model) GenKey(id string) string
- func (s *Model) GetColumn(name string) *Column
- func (s *Model) GetColumns(names ...string) []*Column
- func (s *Model) GetField(name string) *Field
- func (s *Model) GetFrom() *QlFrom
- func (s *Model) GetKeys() []*Column
- func (s *Model) GetSerie() int64
- func (s *Model) Init() error
- func (s *Model) Insert(data et.Json) *Command
- func (s *Model) Load(data []byte) error
- func (s *Model) Low() string
- func (s *Model) New() et.Json
- func (s *Model) OnListener(channels []string, listener HandlerListener)
- func (s *Model) Pk() *Column
- func (s *Model) Query(params et.Json) (interface{}, error)
- func (s *Model) Save() error
- func (s *Model) Serialized() ([]byte, error)
- func (s *Model) SourceIdx() int
- func (s *Model) Undo(key string, index int64) *Command
- func (s *Model) Up() string
- func (s *Model) Update(data et.Json) *Command
- func (s *Model) Where(val string) *Ql
- type Operator
- type Ql
- func (s *Ql) All() (et.Items, error)
- func (s *Ql) And(val string) *Ql
- func (s *Ql) Avg(field string) *Ql
- func (s *Ql) Between(vals interface{}) *Ql
- func (s *Ql) Count(field string) *Ql
- func (s *Ql) Counted() (int, error)
- func (s *Ql) Data(fields ...string) *Ql
- func (s *Ql) Debug() *Ql
- func (s *Ql) Describe() et.Json
- func (s *Ql) Detail(name string, page, rows int, tp TypeResult) *Ql
- func (s *Ql) Eq(val interface{}) *Ql
- func (s *Ql) Exec() (et.Items, error)
- func (s *Ql) Exist() (bool, error)
- func (s *Ql) First(n int) (et.Items, error)
- func (s *Ql) FullJoin(m *Model) *QlJoin
- func (s *Ql) GetDetails(data *et.Json) *et.Json
- func (s *Ql) GroupBy(fields ...string) *Ql
- func (s *Ql) Having(val string) *QlHaving
- func (s *Ql) History(v bool) *Ql
- func (s *Ql) In(val ...any) *Ql
- func (s *Ql) IsNull() *Ql
- func (s *Ql) Join(m *Model) *QlJoin
- func (s *Ql) Last(n int) (et.Items, error)
- func (s *Ql) LeftJoin(m *Model) *QlJoin
- func (s *Ql) Less(val interface{}) *Ql
- func (s *Ql) LessEq(val interface{}) *Ql
- func (s *Ql) Like(val interface{}) *Ql
- func (s *Ql) List(page, rows int) (et.List, error)
- func (s *Ql) Max(field string) *Ql
- func (s *Ql) Min(field string) *Ql
- func (s *Ql) More(val interface{}) *Ql
- func (s *Ql) MoreEq(val interface{}) *Ql
- func (s *Ql) Neg(val interface{}) *Ql
- func (s *Ql) NotNull() *Ql
- func (s *Ql) One() (et.Item, error)
- func (s *Ql) Or(val string) *Ql
- func (s *Ql) OrderBy(sorted bool, columns ...string) *Ql
- func (s *Ql) OrderByAsc(columns ...string) *Ql
- func (s *Ql) OrderByDesc(columns ...string) *Ql
- func (s *Ql) Page(val int) *Ql
- func (s *Ql) Query(params et.Json) (interface{}, error)
- func (s *Ql) RightJoin(m *Model) *QlJoin
- func (s *Ql) Rows(val int) (et.Items, error)
- func (s *Ql) Search(language string, val interface{}) *Ql
- func (s *Ql) Select(fields ...string) *Ql
- func (s *Ql) Sum(field string) *Ql
- func (s *Ql) Where(val string) *Ql
- type QlCondition
- type QlFrom
- type QlFroms
- type QlHaving
- type QlJoin
- type QlJoins
- type QlOrder
- type QlWhere
- func (s *QlWhere) Between(vals interface{}) *QlWhere
- func (s *QlWhere) Debug() *QlWhere
- func (s *QlWhere) Eq(val interface{}) *QlWhere
- func (s *QlWhere) History(v bool) *QlWhere
- func (s *QlWhere) In(val ...any) *QlWhere
- func (s *QlWhere) IsNull() *QlWhere
- func (s *QlWhere) Less(val interface{}) *QlWhere
- func (s *QlWhere) LessEq(val interface{}) *QlWhere
- func (s *QlWhere) Like(val interface{}) *QlWhere
- func (s *QlWhere) More(val interface{}) *QlWhere
- func (s *QlWhere) MoreEq(val interface{}) *QlWhere
- func (s *QlWhere) Neg(val interface{}) *QlWhere
- func (s *QlWhere) NotNull() *QlWhere
- func (s *QlWhere) Search(language string, val interface{}) *QlWhere
- func (s *QlWhere) String() string
- type RID
- type Relation
- type Rollup
- type Schema
- type TypeAgregation
- type TypeColumn
- type TypeCommand
- type TypeData
- type TypeEvent
- type TypeJoin
- type TypeResult
- type TypeSelect
Constants ¶
const ( PRIMARYKEY = "id" PK = PRIMARYKEY KEY = PRIMARYKEY SOURCE = "source" INDEX = "index" PROJECT = "project_id" CREATED_AT = "created_at" UPDATED_AT = "update_at" STATUS = "status" SYSID = "jdbid" CREATED_TO = "created_to" UPDATED_TO = "updated_to" FULLTEXT = "fulltext" HISTORY_INDEX = "hindex" )
const ( SqliteDriver = "sqlite" PostgresDriver = "postgres" MysqlDriver = "mysql" OracleDriver = "oracle" )
const ( MSG_DRIVER_NOT_FOUND = "Driver not found (%s)" MSG_DRIVER_NOT_DEFINED = "Driver not defined" MSS_PARAM_REQUIRED = "Parámetro requerido (%s)" MSG_DATABASE_NOT_FOUND = "Database not found (%s)" MSG_DATABASE_IS_REQUIRED = "Database is required" MSG_SCHEMA_NOT_FOUND = "Schema not found (%s)" MSG_QUERY_FAILED = "Query failed: %s\nSQL: %s" MSG_MODEL_NOT_FOUND = "Model not found (%s)" MSG_MODEL_REQUIRED = "Model is required" MSG_QUERY_EMPTY = "Query is empty" MSG_QUERY_FROM_REQUIRED = "Query 'from' is required" MSG_SYSTEMKEYFIELD_NOT_FOUND = "SystemKeyField not found" MSG_PRIMARYKEY_NOT_FOUND = "PrimaryKey not found" MSG_NOT_DATA = "No data" MSG_NOT_INSERT_DATA = "No insert data" MSG_NOT_UPDATE_DATA = "No update data" MSG_NOT_DELETE_DATA = "No delete data" MSG_KEY_NOT_FOUND = "Key not found" MSG_HISTORY_NOT_DEFINED = "History not defined" MSG_HISTORY_NOT_FOUND = "History not found" MSG_UNDO_NOT_DEFINED = "Undo record not defined" MSG_UNDO_KEY_NOT_DEFINED = "Undo key not defined" MSG_COMMAND_NOT_FOUND = "Command not found" MSG_NOT_COMMAND = "No command" )
Variables ¶
var JDBS []*DB = []*DB{}
Functions ¶
func EventDeleteDefault ¶ added in v1.0.5
* * EventDeleteDefault * @param model *Model, before et.Json, after et.Json * @return error *
func EventErrorDefault ¶ added in v1.0.6
* * EventErrorDefault * @param model *Model, err et.Json *
func EventHistoryDefault ¶ added in v1.0.5
* * EventHistoryDefault * @param model *Model, before et.Json, after et.Json * @return error *
func EventInsertDefault ¶ added in v1.0.5
* * EventInsertDefault * @param model *Model, before et.Json, after et.Json * @return error *
func EventUpdateDefault ¶ added in v1.0.5
* * EventUpdateDefault * @param model *Model, before et.Json, after et.Json * @return error *
func OperatorToCommand ¶
* * OperatorToCommand * @param op Operator * @return string *
func RowsToItem ¶
* * RowsToItem return a item from a sql rows * @param rows *sql.Rows * @return et.Item *
func RowsToItems ¶
* * RowsToItems return a items from a sql rows * @param rows *sql.Rows * @return et.Items *
func SQLDDL ¶
* * SQLDDL return a sql string with the args * @param sql string * @param args ...any * @return string *
func SQLParse ¶
* * SQLParse return a sql string with the args * @param sql string * @param args ...any * @return string *
func SourceToItem ¶
* * SourceToItem return a item from a sql rows and source field * @param source string * @param rows *sql.Rows * @return et.Items *
func SourceToItems ¶ added in v1.0.5
* * SourceToItems return a items from a sql rows and source field * @param source string * @param rows *sql.Rows * @return et.Items *
Types ¶
type Agregation ¶
type Agregation struct {
Agregation string
// contains filtered or unexported fields
}
type Column ¶
type Column struct {
Model *Model `json:"-"`
Source *Column `json:"-"`
Name string `json:"name"`
Description string `json:"description"`
TypeColumn TypeColumn `json:"type_column"`
TypeData TypeData `json:"type_data"`
Default interface{} `json:"default"`
Max float64 `json:"max"`
Min float64 `json:"min"`
Hidden bool `json:"hidden"`
Detail *Relation `json:"detail"`
Rollup *Rollup `json:"rollup"`
FullText *FullText `json:"columns"`
GeneratedFunction GeneratedFunction `json:"-"`
Values []interface{} `json:"values"`
}
func (*Column) DefaultQuote ¶
func (s *Column) DefaultQuote() interface{}
* * DefaultQuote * @return interface{} *
func (*Column) DefaultValue ¶
func (s *Column) DefaultValue() interface{}
* * DefaultValue * @return interface{} *
type ColumnField ¶
type ColumnField string
var ( IndexField ColumnField = INDEX SourceField ColumnField = SOURCE ProjectField ColumnField = PROJECT CreatedAtField ColumnField = CREATED_AT UpdatedAtField ColumnField = UPDATED_AT StateField ColumnField = STATUS PrimaryKeyField ColumnField = PRIMARYKEY SystemKeyField ColumnField = SYSID CreatedToField ColumnField = CREATED_TO UpdatedToField ColumnField = UPDATED_TO FullTextField ColumnField = FULLTEXT )
func (ColumnField) TypeData ¶
func (s ColumnField) TypeData() TypeData
type Command ¶
type Command struct {
*QlWhere
Command TypeCommand
Db *DB
From *Model
Data []et.Json
Values []map[string]*Field
Undo et.Json
Sql string
Result et.Items
// contains filtered or unexported fields
}
func NewCommand ¶
func NewCommand(model *Model, data []et.Json, command TypeCommand) *Command
* * NewCommand * @param model *Model * @param data []et.Json * @param command TypeCommand * @return *Command *
type ConnectParams ¶
type Context ¶ added in v1.0.5
type Context struct {
Ok bool `json:"ok"`
Message Message `json:"message"`
Data interface{} `json:"data"`
}
func NewContext ¶ added in v1.0.5
func NewContext(data interface{}) *Context
* * NewContext * @param data interface{} * @return *Context *
type DB ¶
type DB struct {
CreatedAt time.Time `json:"created_date"`
UpdateAt time.Time `json:"update_date"`
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Schemas map[string]*Schema `json:"schemas"`
UseCore bool `json:"use_core"`
NodeId int64 `json:"node_id"`
Mode Mode `json:"mode"`
Origin string `json:"origin"`
// contains filtered or unexported fields
}
func ConnectTo ¶
func ConnectTo(params ConnectParams) (*DB, error)
* * ConnectTo * @param params et.Json * @return *DB, error *
func NewDatabase ¶
* * NewDatabase * @param name, driver string, nodeId int * @return *DB *
func (*DB) ChangePassword ¶
* * ChangePassword * @return error *
func (*DB) CreateCore ¶ added in v1.0.4
* * CreateCore * @return error *
func (*DB) CreateModel ¶ added in v1.0.3
* * CreateModel * @param model *Model * @return error *
func (*DB) CreateSchema ¶ added in v1.0.3
* * CreateSchema * @param name string * @return error *
func (*DB) CreateUser ¶
* * CreateUser * @return error *
func (*DB) CurrentSerie ¶
* * CurrentSerie * @param tag string * @return int64 *
func (*DB) Data ¶ added in v1.0.5
* * Data * @param source string * @param sql string * @param params ...any * @return et.Item, error *
func (*DB) DeleteUser ¶
* * DeleteUser * @return error *
func (*DB) DropSchema ¶
* * DropSchema * @param name string * @return error *
func (*DB) Exec ¶ added in v1.0.3
* * Exec * @param sql string * @param params ...any * @return error *
func (*DB) GrantPrivileges ¶
* * GrantPrivileges * @return error *
func (*DB) NextCode ¶ added in v1.0.3
* * NextCode * @param tag string * @param format string "%08v" "PREFIX-%08v-SUFFIX" * @return string *
type Driver ¶
type Driver interface {
Name() string
Connect(params et.Json) error
Disconnect() error
SetMain(params et.Json) error
// Database
CreateDatabase(name string) error
DropDatabase(name string) error
// Core
CreateCore() error
// User
GrantPrivileges(username, database string) error
CreateUser(username, password, confirmation string) error
ChangePassword(username, password, confirmation string) error
DeleteUser(username string) error
// Schema
CreateSchema(name string) error
DropSchema(name string) error
// Model
LoadTable(model *Model) (bool, error)
CreateModel(model *Model) error
DropModel(model *Model) error
SaveModel(model *Model) error
// Query
Exec(sql string, arg ...any) error
Query(sql string, arg ...any) (et.Items, error)
One(sql string, arg ...any) (et.Item, error)
Data(source, sql string, arg ...any) (et.Items, error)
Select(ql *Ql) (et.Items, error)
Count(ql *Ql) (int, error)
Exists(ql *Ql) (bool, error)
// Command
Command(command *Command) (et.Items, error)
// Series
GetSerie(tag string) int64
NextCode(tag, prefix string) string
SetSerie(tag string, val int) int64
CurrentSerie(tag string) int64
}
type EventError ¶
type Field ¶
type Field struct {
Column *Column
Schema string
Table string
As string
Name string
Source string
Agregation TypeAgregation
Value interface{}
Alias string
Hidden bool
Page int
Rows int
TpResult TypeResult
}
func (*Field) SetAgregation ¶ added in v1.0.6
func (s *Field) SetAgregation(agr TypeAgregation)
type Flow ¶ added in v1.0.5
type Flow struct {
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Functions []*Function
}
func NewFlow ¶ added in v1.0.5
* * NewFlow * @param name string * @param description string * @return *Flow *
type Function ¶ added in v0.0.1
type GeneratedFunction ¶
type HandlerListener ¶ added in v1.0.4
type Index ¶
type JDB ¶
type JDB struct {
Drivers map[string]func() Driver
DBS map[string]*DB
Schemas map[string]*Schema
Models map[string]*Model
Flows map[string]*Flow
Version string
}
var Jdb *JDB
type Model ¶
type Model struct {
Db *DB `json:"-"`
Schema *Schema `json:"-"`
CreatedAt time.Time `json:"created_date"`
UpdateAt time.Time `json:"update_date"`
ProjectId string `json:"project_id"`
Id string `json:"id"`
Name string `json:"name"`
Table string `json:"table"`
Description string `json:"description"`
Columns []*Column `json:"columns"`
GeneratedFields []*Column `json:"generated_fields"`
PrimaryKeys map[string]*Column `json:"primary_keys"`
ForeignKeys map[string]*Column `json:"foreign_keys"`
Indices map[string]*Index `json:"indices"`
Uniques map[string]*Index `json:"uniques"`
RelationsTo map[string]*Relation `json:"relations_to"`
Details map[string]*Relation `json:"details"`
Rollups map[string]*Rollup `json:"rollups"`
History *Relation `json:"history"`
Required map[string]bool `json:"col_required"`
SystemKeyField *Column `json:"system_key_field"`
StateField *Column `json:"state_field"`
IndexField *Column `json:"index_field"`
SourceField *Column `json:"source_field"`
FullTextField *Column `json:"full_text_field"`
ProjectField *Column `json:"project_field"`
EventError []EventError `json:"-"`
EventsInsert []Event `json:"-"`
EventsUpdate []Event `json:"-"`
EventsDelete []Event `json:"-"`
Integrity bool `json:"integrity"`
IsCreated bool `json:"is_created"`
Version int `json:"version"`
IsDebug bool `json:"-"`
// contains filtered or unexported fields
}
func NewModel ¶
* * NewModel * @param schema *Schema, name string, tp TypeModel, version int * @return *Model *
func NewProjectModel ¶ added in v1.0.7
* * NewProjectModel * @param schema *Schema, projectId, name string, tp TypeModel, version int * @return *Model *
func (*Model) DefineAtribute ¶
* * DefineAtribute * @param name string * @param typeData TypeData * @param def interface{} * @return *Model *
func (*Model) DefineColumn ¶
* * DefineColumnIdx * @param name string, typeData TypeData * @return *Column *
func (*Model) DefineColumnIdx ¶ added in v1.0.6
* * DefineColumnIdx * @param name string, typeData TypeData * @return *Column *
func (*Model) DefineCreatedAtField ¶
* * DefineCreatedAtField * @return *Column *
func (*Model) DefineDetail ¶
* * DefineDetail * @param name, fkn string, limit int * @return *Relation *
func (*Model) DefineEvent ¶
* * DefineEvent * @param tp TypeEvent * @param event Event * @return *Model *
func (*Model) DefineEventError ¶
func (s *Model) DefineEventError(event EventError)
* * DefineEventError * @param event Resilience *
func (*Model) DefineForeignKey ¶
* * DefineForeignKey * @param name []string, with *Model, pkn string * @return *Column *
func (*Model) DefineFullText ¶
* * DefineFullText * @param fields []string * @return language string * @return *Column *
func (*Model) DefineGenerated ¶
func (s *Model) DefineGenerated(name string, fn GeneratedFunction) *Column
* * DefineGenerate * @param name string, fn GeneratedFunction * @return *Column *
func (*Model) DefineHidden ¶
* * DefineHidden * @param colums ...string * @return *Model *
func (*Model) DefineHistory ¶
* * DefineHistory * @param limit int * @return *Relation *
func (*Model) DefineIndex ¶
* * DefineIndex * @param colums ...*Column * @return *Model *
func (*Model) DefineIndexField ¶
* * DefineIndexField * @return *Column *
func (*Model) DefinePrimaryKey ¶
* * DefinePrimaryKey * @param name string * @return *Column *
func (*Model) DefinePrimaryKeyField ¶
* * DefineKeyField * @return *Column *
func (*Model) DefineProjectField ¶
* * DefineProjectField * @return *Column *
func (*Model) DefineProjectModel ¶
* * DefineProjectModel * @return *Model *
func (*Model) DefineRelation ¶
* * DefineRelation * @param name, relatedTo, fkn string, limit int * @return *Relation *
func (*Model) DefineRequired ¶
* * DefineRequired * @param requireds ...string * @return *Model *
func (*Model) DefineRollup ¶
* * DefineRollup * @param name, rollupFrom, property string * @return *Model *
func (*Model) DefineSource ¶
* * DefineSourceField * @return *Column *
func (*Model) DefineSourceField ¶
* * DefineSourceField * @return *Column *
func (*Model) DefineStateField ¶ added in v1.0.5
* * DefineStateField * @return *Column *
func (*Model) DefineSystemKeyField ¶
* * DefineSystemKeyField * @return *Column *
func (*Model) DefineUnique ¶
* * DefineUnique * @param colums ...*Column * @return *Model *
func (*Model) DefineUpdatedAtField ¶
* * DefineUpdatedAtField * @return *Column *
func (*Model) GetColumns ¶ added in v1.0.3
* * GetColumns * @param name string * @return *Column *
func (*Model) OnListener ¶ added in v1.0.4
func (s *Model) OnListener(channels []string, listener HandlerListener)
func (*Model) Serialized ¶ added in v1.0.5
* * Serialized * @return []byte, error *
type Operator ¶
type Operator int
func StrToOperator ¶
* * StrToOperator * @param str string * @return Operator *
type Ql ¶
type Ql struct {
*QlWhere
Db *DB `json:"-"`
TypeSelect TypeSelect `json:"type_select"`
Froms *QlFroms `json:"froms"`
Joins []*QlJoin `json:"joins"`
Selects []*Field `json:"selects"`
Details []*Field `json:"details"`
Rollups []*Field `json:"rollups"`
Groups []*Field `json:"group_bys"`
Havings *QlHaving `json:"havings"`
Orders *QlOrder `json:"orders"`
Sheet int `json:"sheet"`
Offset int `json:"offset"`
Limit int `json:"limit"`
Sql string `json:"sql"`
Result et.Items `json:"result"`
}
func (*Ql) Detail ¶
func (s *Ql) Detail(name string, page, rows int, tp TypeResult) *Ql
* * Detail * @param name string, page, rows int * @return *Ql *
func (*Ql) GetDetails ¶ added in v1.0.5
* * GetDetails * @return et.Json *
func (*Ql) OrderByAsc ¶
* * OrderByAsc * @param columns ...any * @return *Ql *
func (*Ql) OrderByDesc ¶
* * OrderByDesc * @param columns ...any * @return *Ql *
type QlCondition ¶
type QlCondition struct {
Connector Connector
Field *Field
Operator Operator
Value interface{}
Language string
}
func NewQlCondition ¶
func NewQlCondition(field *Field) *QlCondition
* * NewQlCondition * @params key interface{} * @return QlWhere *
func (*QlCondition) GetValue ¶ added in v1.0.6
func (s *QlCondition) GetValue() interface{}
* * GetValue * @param val interface{} * @return string *
func (*QlCondition) String ¶ added in v1.0.6
func (s *QlCondition) String() string
* * String * @return string *
func (*QlCondition) ValStr ¶ added in v1.0.6
func (s *QlCondition) ValStr() string
* * ValStr * @return *string *
type QlHaving ¶
type QlJoin ¶
type QlWhere ¶
type QlWhere struct {
Wheres []*QlCondition
IsDebug bool
// contains filtered or unexported fields
}
type RID ¶ added in v1.0.5
type Relation ¶
type Rollup ¶
type Schema ¶
type Schema struct {
Db *DB `json:"-"`
CreatedAt time.Time `json:"created_date"`
UpdateAt time.Time `json:"update_date"`
Id string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Models map[string]*Model `json:"models"`
}
type TypeAgregation ¶
type TypeAgregation int
const ( Nag TypeAgregation = iota AgregationSum AgregationCount AgregationAvg AgregationMin AgregationMax )
func (TypeAgregation) Str ¶
func (s TypeAgregation) Str() string
type TypeColumn ¶
type TypeColumn int
const ( TpColumn TypeColumn = iota TpAtribute TpGenerated TpRelatedTo TpRollup TpIA )
func (TypeColumn) Str ¶
func (s TypeColumn) Str() string
type TypeData ¶
type TypeData int
func (TypeData) DefaultValue ¶
func (s TypeData) DefaultValue() interface{}
type TypeResult ¶
type TypeResult int
const ( TpResult TypeResult = iota TpList )
func StrToTypeResult ¶
func StrToTypeResult(str string) TypeResult
* * StrToTypeResult * @param str string * @return TypeResult *
Source Files
¶
- adapter.go
- column.go
- command-delete.go
- command-insert.go
- command-prepare.go
- command-undo.go
- command-update.go
- command-where.go
- command.go
- database.go
- drivers.go
- flow.go
- jdb.go
- model-command.go
- model-define.go
- model-event.go
- model-index.go
- model-listener.go
- model-new.go
- model-vmj.go
- model.go
- msg.go
- ql-agregation.go
- ql-concat.go
- ql-condition.go
- ql-details.go
- ql-field.go
- ql-from.go
- ql-groupby.go
- ql-having.go
- ql-join.go
- ql-limit.go
- ql-orderby.go
- ql-parcer.go
- ql-prepare.go
- ql-query.go
- ql-select.go
- ql-where.go
- ql.go
- schema.go