Documentation
¶
Index ¶
- func GetDropdown(db QueryDB, req w2.GetDropdownRequest, opts GetDropdownOptions) (w2.GetDropdownResponse[w2.Dropdown], error)
- func GetDropdownContext(ctx context.Context, db QueryDB, req w2.GetDropdownRequest, ...) (w2.GetDropdownResponse[w2.Dropdown], error)
- func GetForm[T any](db QueryDB, req w2.GetFormRequest, opts GetFormOptions[T]) (w2.GetFormResponse[T], error)
- func GetFormContext[T any](ctx context.Context, db QueryDB, req w2.GetFormRequest, opts GetFormOptions[T]) (w2.GetFormResponse[T], error)
- func GetGrid[T any](db QueryDB, req w2.GetGridRequest, opts GetGridOptions[T]) (w2.GetGridResponse[T], error)
- func GetGridContext[T any](ctx context.Context, db QueryDB, req w2.GetGridRequest, opts GetGridOptions[T]) (w2.GetGridResponse[T], error)
- func InsertForm[T any](db ExecDB, req w2.SaveFormRequest[T], opts InsertFormOptions) (int, error)
- func InsertFormContext[T any](ctx context.Context, db ExecDB, req w2.SaveFormRequest[T], ...) (int, error)
- func RemoveGrid(db ExecDB, req w2.RemoveGridRequest, opts RemoveGridOptions) (int, error)
- func RemoveGridContext(ctx context.Context, db ExecDB, req w2.RemoveGridRequest, ...) (int, error)
- func ReorderGrid(db QueryExecDB, req w2.ReorderGridRequest, opts ReorderGridOptions) (int, error)
- func ReorderGridContext(ctx context.Context, db QueryExecDB, req w2.ReorderGridRequest, ...) (int, error)
- func SaveGrid[T any](db ExecDB, req w2.SaveGridRequest[T], opts SaveGridOptions[T]) (int, error)
- func SaveGridContext[T any](ctx context.Context, db ExecDB, req w2.SaveGridRequest[T], ...) (int, error)
- func SetLogger(logger *slog.Logger)
- func SetSlowThreshold(threshold time.Duration)
- func UpdateForm[T any](db ExecDB, req w2.SaveFormRequest[T], opts UpdateFormOptions) (int, error)
- func UpdateFormContext[T any](ctx context.Context, db ExecDB, req w2.SaveFormRequest[T], ...) (int, error)
- func WithinTransaction(db *sql.DB, fn func(tx *sql.Tx) error) error
- func WithinTransactionContext(ctx context.Context, db *sql.DB, ...) error
- type ExecDB
- type GetDropdownOptions
- type GetFormOptions
- type GetGridOptions
- type InsertFormOptions
- type QueryDB
- type QueryExecDB
- type RemoveGridOptions
- type ReorderGridOptions
- type SaveGridOptions
- type UpdateFormOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDropdown ¶
func GetDropdown(db QueryDB, req w2.GetDropdownRequest, opts GetDropdownOptions) (w2.GetDropdownResponse[w2.Dropdown], error)
func GetDropdownContext ¶
func GetDropdownContext(ctx context.Context, db QueryDB, req w2.GetDropdownRequest, opts GetDropdownOptions) (w2.GetDropdownResponse[w2.Dropdown], error)
func GetForm ¶
func GetForm[T any](db QueryDB, req w2.GetFormRequest, opts GetFormOptions[T]) (w2.GetFormResponse[T], error)
func GetFormContext ¶
func GetFormContext[T any](ctx context.Context, db QueryDB, req w2.GetFormRequest, opts GetFormOptions[T]) (w2.GetFormResponse[T], error)
func GetGrid ¶
func GetGrid[T any](db QueryDB, req w2.GetGridRequest, opts GetGridOptions[T]) (w2.GetGridResponse[T], error)
func GetGridContext ¶
func GetGridContext[T any](ctx context.Context, db QueryDB, req w2.GetGridRequest, opts GetGridOptions[T]) (w2.GetGridResponse[T], error)
func InsertForm ¶
func InsertForm[T any](db ExecDB, req w2.SaveFormRequest[T], opts InsertFormOptions) (int, error)
func InsertFormContext ¶
func InsertFormContext[T any](ctx context.Context, db ExecDB, req w2.SaveFormRequest[T], opts InsertFormOptions) (int, error)
func RemoveGrid ¶
func RemoveGrid(db ExecDB, req w2.RemoveGridRequest, opts RemoveGridOptions) (int, error)
func RemoveGridContext ¶
func RemoveGridContext(ctx context.Context, db ExecDB, req w2.RemoveGridRequest, opts RemoveGridOptions) (int, error)
func ReorderGrid ¶
func ReorderGrid(db QueryExecDB, req w2.ReorderGridRequest, opts ReorderGridOptions) (int, error)
func ReorderGridContext ¶
func ReorderGridContext(ctx context.Context, db QueryExecDB, req w2.ReorderGridRequest, opts ReorderGridOptions) (int, error)
func SaveGrid ¶
func SaveGrid[T any](db ExecDB, req w2.SaveGridRequest[T], opts SaveGridOptions[T]) (int, error)
func SaveGridContext ¶
func SaveGridContext[T any](ctx context.Context, db ExecDB, req w2.SaveGridRequest[T], opts SaveGridOptions[T]) (int, error)
func SetSlowThreshold ¶ added in v0.2.44
func UpdateForm ¶
func UpdateForm[T any](db ExecDB, req w2.SaveFormRequest[T], opts UpdateFormOptions) (int, error)
func UpdateFormContext ¶
func UpdateFormContext[T any](ctx context.Context, db ExecDB, req w2.SaveFormRequest[T], opts UpdateFormOptions) (int, error)
Types ¶
type GetDropdownOptions ¶
type GetDropdownOptions struct {
From string
IDField string
TextField string
OrderByField string
BuildSelect func(sb *sqlbuilder.SelectBuilder)
Flavor sqlbuilder.Flavor
Logger *slog.Logger
}
type GetFormOptions ¶
type GetFormOptions[T any] struct { From string IDField string Select []string Flavor sqlbuilder.Flavor BuildSelect func(sb *sqlbuilder.SelectBuilder) Scan func(row *sql.Row) (T, error) Logger *slog.Logger }
type GetGridOptions ¶
type GetGridOptions[T any] struct { From string Select []string CountExpr string WhereMapping map[string]string OrderByMapping map[string]string Flavor sqlbuilder.Flavor BuildBase func(sb *sqlbuilder.SelectBuilder) BuildSelect func(sb *sqlbuilder.SelectBuilder) Scan func(rows *sql.Rows) (T, error) Logger *slog.Logger }
type InsertFormOptions ¶
type QueryExecDB ¶
type RemoveGridOptions ¶
type ReorderGridOptions ¶
type ReorderGridOptions struct {
Update string
IDField string
SetField string
Flavor sqlbuilder.Flavor
BuildSelect func(sb *sqlbuilder.SelectBuilder)
Logger *slog.Logger
}
type SaveGridOptions ¶
type SaveGridOptions[T any] struct { Flavor sqlbuilder.Flavor BuildUpdate func(change T) *sqlbuilder.UpdateBuilder Logger *slog.Logger }
type UpdateFormOptions ¶
Click to show internal directories.
Click to hide internal directories.