Documentation ¶
Index ¶
- Variables
- func Delete(ctx context.Context, db Querier, flavor Flavor, tableName string, ...) error
- func DeleteWithOptions(ctx context.Context, db Querier, flavor Flavor, tableName string, ...) error
- func Get(ctx context.Context, db Querier, tableName string, options *FindOptions, ...) error
- func Insert(ctx context.Context, db Querier, flavor Flavor, tag, tableName string, ...) error
- func Select(ctx context.Context, db Querier, tableName string, options *FindAllOptions, ...) error
- func Update(ctx context.Context, db Querier, flavor Flavor, tag, tableName string, ...) error
- func UpdateWithOptions(ctx context.Context, db Querier, flavor Flavor, tableName string, ...) error
- type DeleteOptions
- type FindAllOptions
- type FindOptions
- type Flavor
- type Querier
- type UpdateOptions
Constants ¶
This section is empty.
Variables ¶
var ( MySQLFlavor = sqlquery.MySQLFlavor PostgreSQLFlavor = sqlquery.PostgreSQLFlavor SQLiteFlavor = sqlquery.SQLiteFlavor )
Functions ¶
func DeleteWithOptions ¶ added in v1.8.0
func DeleteWithOptions(ctx context.Context, db Querier, flavor Flavor, tableName string, options *DeleteOptions) error
DeleteWithOptions is a high-level function that calls sqlquery.DeleteWithOptionsQuery and db.ExecContext.
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 sqlscan.Get function.
func Insert ¶
func Insert(ctx context.Context, db Querier, flavor Flavor, tag, tableName string, structValue interface{}) error
Insert is a high-level function that calls sqlquery.InsertQuery and db.ExecContext.
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 sqlscan.Select function.
func Update ¶
func Update(ctx context.Context, db Querier, flavor Flavor, tag, tableName string, id interface{}, structValue interface{}) error
Update is a high-level function that calls sqlquery.UpdateQuery and db.ExecContext.
func UpdateWithOptions ¶ added in v1.8.0
func UpdateWithOptions(ctx context.Context, db Querier, flavor Flavor, tableName string, options *UpdateOptions) error
UpdateWithOptions is a high-level function that calls sqlquery.UpdateWithOptionsQuery and db.ExecContext.
Types ¶
type DeleteOptions ¶ added in v1.8.0
type DeleteOptions = sqlquery.DeleteOptions
func NewDeleteOptions ¶ added in v1.8.0
func NewDeleteOptions(flavor Flavor) *DeleteOptions
NewDeleteOptions returns a DeleteOptions.
type FindAllOptions ¶
type FindAllOptions = sqlquery.FindAllOptions
func NewFindAllOptions ¶
func NewFindAllOptions(flavor Flavor) *FindAllOptions
NewFindAllOptions returns a FindAllOptions.
type FindOptions ¶
type FindOptions = sqlquery.FindOptions
func NewFindOptions ¶
func NewFindOptions(flavor Flavor) *FindOptions
NewFindOptions returns a FindOptions.
type Querier ¶ added in v1.2.0
type Querier interface { QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) }
Querier is a abstraction over *sql.DB/*sql.Conn/*sql.Tx.
type UpdateOptions ¶ added in v1.8.0
type UpdateOptions = sqlquery.UpdateOptions
func NewUpdateOptions ¶ added in v1.8.0
func NewUpdateOptions(flavor Flavor) *UpdateOptions
NewUpdateOptions returns a UpdateOptions.