Documentation
¶
Overview ¶
Package dal provides a database access layer.
Index ¶
- type Model
- func (model Model) Cleanup(table, fieldTime string, tm int64) (err error)
- func (model Model) Create(table string, values interface{}) (rowsAffected int64, err error)
- func (model Model) DBInfo() (info []string)
- func (model *Model) Read(table string, columns []string, condition string, v interface{}) (err error)
- func (model *Model) ReadPlain(table string, fields []string, condition string, readType interface{}) (err error)
- func (model Model) SQL(query string) (err error)
- func (model Model) Update(table string, values interface{}) (rowsAffected int64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct { DriverName string DataSourceName string BatchSize int Records []interface{} // contains filtered or unexported fields }
TODO: Model.Read() is not parallel-able Field `Records` contains the latest query results. Default batch size is 4K, if record-size is 4K, the max_allowed_package 16M is reached.
func (Model) Create ¶ added in v0.0.4
Create does insert-ignore on the given table. The values must be a non-empty slice of the same type.
Click to show internal directories.
Click to hide internal directories.