Documentation
¶
Index ¶
- func AVG[T number](col string, v *sql.Null[T]) *avg[T]
- func COUNT[T number](col string, v *sql.Null[T]) *count[T]
- func MAX[T number](col string, v *sql.Null[T]) *max[T]
- func MIN[T number](col string, v *sql.Null[T]) *min[T]
- func RunExamples(db *sql.DB)
- func SUM[T number](col string, v *sql.Null[T]) *sum[T]
- type Cte
- type Delete
- type ExampleModel
- type Execer
- type Insert
- func (d *Insert[T]) COLUMNS(cols ...string) *Insert[T]
- func (d *Insert[T]) Debug() *Insert[T]
- func (d *Insert[T]) DryRun(ctx context.Context) (int64, error)
- func (d *Insert[T]) Exec(ctx context.Context, db Execer) (int64, error)
- func (d *Insert[T]) INTO(table string) *Insert[T]
- func (d *Insert[T]) ON(conflict string) *Insert[T]
- func (d *Insert[T]) Omit(cols ...string) *Insert[T]
- func (d *Insert[T]) SQL() string
- func (d *Insert[T]) UPDATE(conds map[string]any) *Insert[T]
- func (d *Insert[T]) VALUES(args ...any) *Insert[T]
- type M
- type Mapping
- type Model
- type PModel
- type SelectModel
- func (d SelectModel) CROSS_JOIN(table string) *T
- func (d SelectModel) CTE(cte string) *T
- func (d SelectModel) Debug() *T
- func (d SelectModel) DryRun(ctx context.Context) error
- func (d SelectModel) FOR(lock string) *T
- func (d SelectModel) FROM(table string) *T
- func (d SelectModel) FULL_JOIN(table string) *T
- func (d SelectModel) GROUP_BY(cols ...string) *T
- func (d SelectModel) HAVING(cond string) *T
- func (d SelectModel) INNER_JOIN(table string) *T
- func (d SelectModel) JOIN(table string) *T
- func (d SelectModel) LEFT_JOIN(table string) *T
- func (d SelectModel) LIMIT(limit int64) *T
- func (d SelectModel) OFFSET(offset int64) *T
- func (d SelectModel) ON(condition string) *T
- func (d SelectModel) ORDER_BY(orders ...string) *T
- func (d SelectModel) Omit(cols ...string) *T
- func (d *SelectModel) Query(ctx context.Context, db Execer) error
- func (d SelectModel) RIGHT_JOIN(table string) *T
- func (d SelectModel) SQL() string
- func (d SelectModel) UNION(selet string) *T
- func (d SelectModel) UNION_ALL(selet string) *T
- func (d SelectModel) WHERE(where map[string]any) *T
- type SelectModels
- func (d SelectModels) CROSS_JOIN(table string) *T
- func (d SelectModels) CTE(cte string) *T
- func (d SelectModels) Debug() *T
- func (d SelectModels) DryRun(ctx context.Context) error
- func (d SelectModels) FOR(lock string) *T
- func (d SelectModels) FROM(table string) *T
- func (d SelectModels) FULL_JOIN(table string) *T
- func (d SelectModels) GROUP_BY(cols ...string) *T
- func (d SelectModels) HAVING(cond string) *T
- func (d SelectModels) INNER_JOIN(table string) *T
- func (d SelectModels) JOIN(table string) *T
- func (d SelectModels) LEFT_JOIN(table string) *T
- func (d SelectModels) LIMIT(limit int64) *T
- func (d SelectModels) OFFSET(offset int64) *T
- func (d SelectModels) ON(condition string) *T
- func (d SelectModels) ORDER_BY(orders ...string) *T
- func (d SelectModels) Omit(cols ...string) *T
- func (d *SelectModels[T, P]) Query(ctx context.Context, db Execer) error
- func (d SelectModels) RIGHT_JOIN(table string) *T
- func (d SelectModels) SQL() string
- func (d SelectModels) UNION(selet string) *T
- func (d SelectModels) UNION_ALL(selet string) *T
- func (d SelectModels) WHERE(where map[string]any) *T
- type SelectString
- func (d SelectString) CROSS_JOIN(table string) *T
- func (d SelectString) CTE(cte string) *T
- func (d SelectString) Debug() *T
- func (d SelectString) DryRun(ctx context.Context) error
- func (d SelectString) FOR(lock string) *T
- func (d SelectString) FROM(table string) *T
- func (d SelectString) FULL_JOIN(table string) *T
- func (d SelectString) GROUP_BY(cols ...string) *T
- func (d SelectString) HAVING(cond string) *T
- func (d SelectString) INNER_JOIN(table string) *T
- func (d SelectString) JOIN(table string) *T
- func (d SelectString) LEFT_JOIN(table string) *T
- func (d SelectString) LIMIT(limit int64) *T
- func (d SelectString) OFFSET(offset int64) *T
- func (d SelectString) ON(condition string) *T
- func (d SelectString) ORDER_BY(orders ...string) *T
- func (d SelectString) Omit(cols ...string) *T
- func (d SelectString) RIGHT_JOIN(table string) *T
- func (d SelectString) SQL() string
- func (d SelectString) UNION(selet string) *T
- func (d SelectString) UNION_ALL(selet string) *T
- func (d SelectString) WHERE(where map[string]any) *T
- type Transaction
- type Update
- func (d *Update) Debug() *Update
- func (d *Update) DryRun(ctx context.Context) (int64, error)
- func (d *Update) Exec(ctx context.Context, db Execer) (int64, error)
- func (d *Update) Omit(cols ...string) *Update
- func (d *Update) SET(set map[string]any) *Update
- func (d *Update) SET1(row Model) *Update
- func (d *Update) SQL() string
- func (d *Update) WHERE(where map[string]any) *Update
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ExampleModel ¶
func (*ExampleModel) Mapping ¶
func (m *ExampleModel) Mapping() []*Mapping
type Execer ¶
type Execer interface {
ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)
QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error)
QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row
}
sql.DB | sql.Tx
type SelectModel ¶
type SelectModel struct {
// contains filtered or unexported fields
}
func SELECT1 ¶
func SELECT1(row Model) *SelectModel
func (SelectModel) CROSS_JOIN ¶
func (d SelectModel) CROSS_JOIN(table string) *T
func (SelectModel) INNER_JOIN ¶
func (d SelectModel) INNER_JOIN(table string) *T
func (SelectModel) RIGHT_JOIN ¶
func (d SelectModel) RIGHT_JOIN(table string) *T
type SelectModels ¶
func SELECT2 ¶
func SELECT2[T any, P PModel[T]](rows *[]*T) *SelectModels[T, P]
func (SelectModels) CROSS_JOIN ¶
func (d SelectModels) CROSS_JOIN(table string) *T
func (SelectModels) INNER_JOIN ¶
func (d SelectModels) INNER_JOIN(table string) *T
func (*SelectModels[T, P]) Query ¶
func (d *SelectModels[T, P]) Query(ctx context.Context, db Execer) error
func (SelectModels) RIGHT_JOIN ¶
func (d SelectModels) RIGHT_JOIN(table string) *T
type SelectString ¶
type SelectString struct {
// contains filtered or unexported fields
}
func SELECT ¶
func SELECT(cols ...string) *SelectString
func (SelectString) CROSS_JOIN ¶
func (d SelectString) CROSS_JOIN(table string) *T
func (SelectString) INNER_JOIN ¶
func (d SelectString) INNER_JOIN(table string) *T
func (SelectString) RIGHT_JOIN ¶
func (d SelectString) RIGHT_JOIN(table string) *T
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
func (*Transaction) WithOpts ¶
func (t *Transaction) WithOpts(opts *sql.TxOptions) *Transaction
Click to show internal directories.
Click to hide internal directories.