Documentation ¶
Index ¶
- func Delete(ctx context.Context, db Querier, tableName string, id interface{}) error
- func DeleteWithOptions(ctx context.Context, db Querier, tableName string, options *DeleteOptions) error
- func Get(ctx context.Context, db Querier, tableName string, options *FindOptions, ...) error
- func Insert(ctx context.Context, db Querier, tag, tableName string, ...) error
- func Select(ctx context.Context, db Querier, tableName string, options *FindAllOptions, ...) error
- func Update(ctx context.Context, db Querier, tag, tableName string, id interface{}, ...) error
- func UpdateWithOptions(ctx context.Context, db Querier, tableName string, options *UpdateOptions) error
- type DeleteOptions
- type FindAllOptions
- type FindOptions
- type Querier
- type UpdateOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteWithOptions ¶ added in v2.3.0
func DeleteWithOptions(ctx context.Context, db Querier, tableName string, options *DeleteOptions) error
DeleteWithOptions is a high-level function that calls sqlquery.DeleteWithOptionsQuery and pgx Exec.
func Get ¶
func Get(ctx context.Context, db Querier, tableName string, options *FindOptions, dst interface{}) error
Get is a high-level function that calls sqlquery.FindQuery and scany pgxscan.Get function.
func Select ¶
func Select(ctx context.Context, db Querier, tableName string, options *FindAllOptions, dst interface{}) error
Select is a high-level function that calls sqlquery.FindAllQuery and scany pgxscan.Select function.
func Update ¶
func Update(ctx context.Context, db Querier, tag, tableName string, id interface{}, structValue interface{}) error
Update is a high-level function that calls sqlquery.UpdateQuery and pgx Exec.
func UpdateWithOptions ¶ added in v2.3.0
func UpdateWithOptions(ctx context.Context, db Querier, tableName string, options *UpdateOptions) error
UpdateWithOptions is a high-level function that calls sqlquery.UpdateWithOptionsQuery and pgx Exec.
Types ¶
type DeleteOptions ¶ added in v2.3.0
type DeleteOptions = sqlquery.DeleteOptions
func NewDeleteOptions ¶ added in v2.3.0
func NewDeleteOptions() *DeleteOptions
NewDeleteOptions returns a DeleteOptions
type FindAllOptions ¶
type FindAllOptions = sqlquery.FindAllOptions
func NewFindAllOptions ¶
func NewFindAllOptions() *FindAllOptions
NewFindAllOptions returns a FindAllOptions.
type FindOptions ¶
type FindOptions = sqlquery.FindOptions
type Querier ¶
type Querier interface { Query(ctx context.Context, query string, args ...interface{}) (pgx.Rows, error) Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error) }
Querier is a abstraction over *pgxpool.Pool/*pgx.Conn/pgx.Tx.
type UpdateOptions ¶ added in v2.3.0
type UpdateOptions = sqlquery.UpdateOptions
func NewUpdateOptions ¶ added in v2.3.0
func NewUpdateOptions() *UpdateOptions
NewUpdateOptions returns a UpdateOptions