Documentation
¶
Index ¶
- Variables
- func ExecContext(ctx context.Context, db Execer, baseSQL string, baseArgs []any, ...) (sql.Result, error)
- func GetContext(ctx context.Context, db Queryer, dest interface{}, baseSQL string, ...) error
- func Query(ctx context.Context, baseSQL string, opts ...data.FilterOption) (string, []any, error)
- func QueryWithArgs(ctx context.Context, baseSQL string, baseArgs []any, opts ...data.FilterOption) (string, []any, error)
- func SelectContext(ctx context.Context, db Queryer, dest interface{}, baseSQL string, ...) error
- type Execer
- type Queryer
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnsafeSQL = errors.New("gotenancy/sqlx: unsafe sql")
)
Functions ¶
func ExecContext ¶
func ExecContext(ctx context.Context, db Execer, baseSQL string, baseArgs []any, opts ...data.FilterOption) (sql.Result, error)
ExecContext runs a tenant-filtered write statement.
func GetContext ¶
func GetContext(ctx context.Context, db Queryer, dest interface{}, baseSQL string, baseArgs []any, opts ...data.FilterOption) error
GetContext runs a tenant-filtered single-row SELECT.
func QueryWithArgs ¶
func QueryWithArgs(ctx context.Context, baseSQL string, baseArgs []any, opts ...data.FilterOption) (string, []any, error)
QueryWithArgs adds the tenant filter to a base SQL statement and preserves existing args.
func SelectContext ¶
func SelectContext(ctx context.Context, db Queryer, dest interface{}, baseSQL string, baseArgs []any, opts ...data.FilterOption) error
SelectContext runs a tenant-filtered SELECT.
Types ¶
Click to show internal directories.
Click to hide internal directories.