Documentation ¶
Index ¶
- Constants
- type BaseModel
- type Handler
- type IEngine
- type IModel
- type IModelDataAdapters
- type IModelDataConverters
- type IModelDefaultOrders
- type IModelInitializeData
- type IModelUpgradeTableSchema
- type KwArgs
- type ModelData
- type ModelDataMappers
- type Query
- func (qry *Query) All() ([]ModelData, error)
- func (qry *Query) Columns(columns ...string) *Query
- func (qry *Query) Count() (int64, error)
- func (qry *Query) Delete() (int64, error)
- func (qry *Query) Filter(expr string, params ...any) *Query
- func (qry *Query) FilterBy(column string, value any) *Query
- func (qry *Query) First() (ModelData, error)
- func (qry *Query) GenerateGuid() string
- func (qry *Query) Get(guid string) (ModelData, error)
- func (qry *Query) GroupBy(groupby ...string) *Query
- func (qry *Query) Having(expr string, val any) *Query
- func (qry *Query) Insert(data ModelData) (string, error)
- func (qry *Query) Limit(limit int) *Query
- func (qry *Query) Offset(offset int) *Query
- func (qry *Query) One() (ModelData, error)
- func (qry *Query) OrderBy(orderby ...string) *Query
- func (qry *Query) SqlIdent(name string) string
- func (qry *Query) Table(name TableName) *Query
- func (qry *Query) Update(data ModelData) (int64, error)
- type Session
- func (sess *Session) Begin() error
- func (sess *Session) Close() error
- func (sess *Session) Commit() error
- func (sess *Session) Connect() error
- func (sess *Session) Execute(stmt string, params ...any) error
- func (sess *Session) FetchAll(stmt string, params ...any) ([]ModelData, error)
- func (sess *Session) InTransaction() bool
- func (sess *Session) IsConnected() bool
- func (sess *Session) Query(model IModel) *Query
- func (sess *Session) RollBack() error
- func (sess *Session) RowsAffected() int64
- type TableColumns
- type TableConstraints
- type TableMeta
- type TableName
Constants ¶
View Source
const SQL_PLACEHOLDER = "$?"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseModel ¶
type BaseModel = struct{}
types for table data, where colums are mapped as keys and table conversion functions for data read and write
type Handler ¶
func NewHandler ¶
func (*Handler) InitDatabase ¶
create database tables and initialize data
type IEngine ¶
type IEngine interface { GetBackendName() string FormatSqlStmt(string) string Connect(KwArgs) (*sql.DB, error) GenTableSchema(TableName, TableMeta) ([]string, error) ListRetryErrors() []string }
backend engine interface
type IModelDataAdapters ¶
type IModelDataAdapters interface {
GetDataAdapters() ModelDataMappers
}
type IModelDataConverters ¶
type IModelDataConverters interface {
GetDataConverters() ModelDataMappers
}
type IModelDefaultOrders ¶
type IModelDefaultOrders interface {
GetDefaultOrders() []string
}
type IModelInitializeData ¶
type ModelDataMappers ¶
type Query ¶
func (*Query) GenerateGuid ¶
func (*Query) One ¶
return one element matching filter params or nil there must be only one element or none
type Session ¶
type Session struct { DBh *Handler // contains filtered or unexported fields }
func NewSession ¶
func (*Session) InTransaction ¶
func (*Session) IsConnected ¶
func (*Session) RowsAffected ¶
type TableColumns ¶
type TableColumns = [][]string
type TableConstraints ¶
type TableConstraints = [][]string
type TableMeta ¶
type TableMeta = struct { Options KwArgs Columns TableColumns Constraints TableConstraints }
Click to show internal directories.
Click to hide internal directories.