Documentation
¶
Index ¶
- func Columns(ctx context.Context, m Model) []string
- func Context(ctx context.Context, db *sql.DB) context.Context
- func DBForContext(ctx context.Context) *sql.DB
- func ForContext(ctx context.Context) (*sql.Conn, error)
- func Middleware(db *sql.DB) func(http.Handler) http.Handler
- func Scan(ctx context.Context, m Model) []any
- func ScanAll(m Model) []any
- func Select(ctx context.Context, cols ...any) sq.SelectBuilder
- func SelectAll(m Model) sq.SelectBuilder
- func WithAlias(alias, col string) string
- func WithReadOnlyTx(ctx context.Context, fn func(tx *sql.Tx) error) error
- func WithTx(ctx context.Context, opts *sql.TxOptions, fn func(tx *sql.Tx) error) error
- type ExtendedModel
- type FieldMap
- type Model
- type ModelFields
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SelectAll ¶
func SelectAll(m Model) sq.SelectBuilder
Types ¶
type ExtendedModel ¶
type ExtendedModel interface {
Model
Select(q sq.SelectBuilder) sq.SelectBuilder
}
type FieldMap ¶
Provides a mapping between PostgreSQL columns, GQL fields, and Go struct fields for all of the data associated with a model.
type Model ¶
type Model interface {
Alias() string
Fields() *ModelFields
Table() string
}
type ModelFields ¶
type ModelFields struct {
Fields []*FieldMap
// contains filtered or unexported fields
}
func (*ModelFields) All ¶
func (mf *ModelFields) All() []*FieldMap
func (*ModelFields) Anonymous ¶
func (mf *ModelFields) Anonymous() []*FieldMap
Click to show internal directories.
Click to hide internal directories.