Documentation ¶
Index ¶
- Constants
- func ColumnsFromTag(table interface{}, forInsert bool, requireFields []string) (columns []string, err error)
- func FieldsFromLocalTable(table interface{}, forInsert bool) (fields []string, err error)
- func NewRowsInstance(base interface{}) (rows interface{})
- func SQLRowsToStructureRows(sqlRows *sql.Rows, targetRowType interface{}) (rows []interface{}, err error)
- func StringDataFromRow(row interface{}, requiredField []string) (data []interface{})
- type BasicRows
- type BasicTable
- type IDriver
- type IRows
- type ITable
- type SimplePagingQueryParam
- type SimplePagingQueryResult
Constants ¶
View Source
const ( ColumnNameTag = "col" DefaultValueTag = "def" IgnoreForInsertTag = "ignoreInsert" )
Variables ¶
This section is empty.
Functions ¶
func ColumnsFromTag ¶
func FieldsFromLocalTable ¶
func NewRowsInstance ¶
func NewRowsInstance(base interface{}) (rows interface{})
func SQLRowsToStructureRows ¶
func StringDataFromRow ¶
func StringDataFromRow(row interface{}, requiredField []string) (data []interface{})
Types ¶
type BasicRows ¶
type BasicRows struct { Rows []interface{} Instance IRows }
func (BasicRows) DataForInsert ¶
func (b BasicRows) DataForInsert() (data []interface{})
type BasicTable ¶
type BasicTable struct { Instance interface{} // contains filtered or unexported fields }
func (BasicTable) Columns ¶
func (b BasicTable) Columns() (list []string)
func (BasicTable) ColumnsForInsert ¶
func (b BasicTable) ColumnsForInsert() (list []string)
func (BasicTable) FieldForInsert ¶
func (b BasicTable) FieldForInsert() (fields []string)
func (BasicTable) FieldsToColumns ¶
func (b BasicTable) FieldsToColumns(fields []string) []string
func (BasicTable) Name ¶
func (b BasicTable) Name() string
type IDriver ¶
type IDriver interface { Insert(rows IRows, ignoreKey bool) (result sql.Result, err error) Replace(rows IRows) (result sql.Result, err error) Update(rows IRows, fields []string, condition string, args []interface{}) (result sql.Result, err error) Query(rowType interface{}, sql string, args []interface{}) (rows []interface{}, err error) SimpleSelect(rowType interface{}, table string, col string, equalVal interface{}) (rows []interface{}, err error) RowCount(table string, condition string, args []interface{}) (cnt uint64, err error) SimplePagingQuery(param SimplePagingQueryParam) (ret *SimplePagingQueryResult, err error) }
type SimplePagingQueryParam ¶
type SimplePagingQueryParam struct { Page int64 Count int64 Table string RowType interface{} Condition string ConditionArgs []interface{} }
func (*SimplePagingQueryParam) PageFromString ¶
func (s *SimplePagingQueryParam) PageFromString(page string)
type SimplePagingQueryResult ¶
type SimplePagingQueryResult struct { Total uint64 Rows interface{} }
Click to show internal directories.
Click to hide internal directories.