Documentation ¶
Index ¶
- func CheckColumnType(ctx context.Context, tx bun.Tx, model interface{}, column string) (string, error)
- func DeleteUnusedRows(ctx context.Context, tx bun.Tx, model interface{}, ...) error
- func Init(dataBase *bun.DB)
- func InsertRowsIfNotExist(ctx context.Context, tx bun.Tx, model interface{}, columns []string) error
- func RunInTx(ctx context.Context, fs ...txFunc) error
- type ModelSelector
- type TableData
- type TableDataArray
- type UID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckColumnType ¶
func CheckColumnType(ctx context.Context, tx bun.Tx, model interface{}, column string) (string, error)
CheckColumnType returns the type of the column.
func DeleteUnusedRows ¶
func DeleteUnusedRows(ctx context.Context, tx bun.Tx, model interface{}, fkTable, fkColumn, column string) error
DeleteUnusedRows remove rows from table (model) if any value of this table's column is not contained in other table's (fkTable) column (fkColumn).
func InsertRowsIfNotExist ¶
Types ¶
type TableData ¶
type TableData struct { Column string Key interface{} Value interface{} }
func (*TableData) UpdateCell ¶
func (td *TableData) UpdateCell(ctx context.Context, db *bun.DB, model interface{}, pkColumn string, returnedModel ModelSelector) error
UpdateCell set value of TableData.Column to TableData.Value where value of column TableData.Key is equal to pkColumn.
type TableDataArray ¶
type TableDataArray []*TableData
type UID ¶
type UID struct { Update TableDataArray Insert TableDataArray Delete []string }
Click to show internal directories.
Click to hide internal directories.