Documentation
¶
Index ¶
- Variables
- func FilterUsersEmailPrefix(scopePrefix string) runtime.Tree
- func FilterUsersStatusEq(scopeStatus string) runtime.Tree
- func FilterUsersTenant(scopeTenantID int64) runtime.Tree
- func FilterUsersUnscoped() runtime.Tree
- type CountByStatusParams
- type CountByStatusRow
- type DBTX
- type FilterUsersParams
- type FilterUsersRow
- type FindUserByEmailParams
- type FindUserByEmailRow
- type Querier
- type Queries
- func (q *Queries) Cache() *runtime.ComposedCache
- func (q *Queries) CountByStatus(ctx context.Context, arg CountByStatusParams) ([]CountByStatusRow, error)
- func (q *Queries) FilterUsers(ctx context.Context, scope runtime.Tree, arg FilterUsersParams) ([]FilterUsersRow, error)
- func (q *Queries) FindUserByEmail(ctx context.Context, arg FindUserByEmailParams) (optional.Option[FindUserByEmailRow], error)
- func (q *Queries) OnQuery(fn func(shapeKey, sql string))
- func (q *Queries) SearchUsers(ctx context.Context, arg SearchUsersParams) ([]SearchUsersRow, error)
- func (q *Queries) SetObserver(o runtime.Observer)
- func (q *Queries) UsersInStatuses(ctx context.Context, arg UsersInStatusesParams) ([]UsersInStatusesRow, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type SearchUsersParams
- type SearchUsersRow
- type SearchUsersSort
- type UsersInStatusesParams
- type UsersInStatusesRow
Constants ¶
This section is empty.
Variables ¶
var ( And = runtime.And Or = runtime.Or )
And / Or combine @filter-tree predicates built with the generated per-query constructors.
var ShapeSpace = map[string]runtime.ShapeSpaceInfo{ "CountByStatus": {Enumerable: 1, Exact: true, Unbounded: false}, "FilterUsers": {Enumerable: 1, Exact: true, Unbounded: true}, "FindUserByEmail": {Enumerable: 1, Exact: true, Unbounded: false}, "SearchUsers": {Enumerable: 8, Exact: true, Unbounded: false}, "UsersInStatuses": {Enumerable: 1, Exact: true, Unbounded: true}, }
ShapeSpace describes each query's reachable shape space, computed at generate time (design doc 18): the enumerable dimensions' shape count, whether that count is exact (large @order-by permutation spaces saturate at MaxUint64), and whether unbounded dimensions exist (@filter-tree structure; @in arity on expanding dialects) — under which used-vs-reachable coverage is a floor, never a ratio.
Functions ¶
func FilterUsersEmailPrefix ¶
FilterUsersEmailPrefix builds the "email_prefix" predicate of @filter-tree(scope).
func FilterUsersStatusEq ¶
FilterUsersStatusEq builds the "status_eq" predicate of @filter-tree(scope).
func FilterUsersTenant ¶
FilterUsersTenant builds the "tenant" predicate of @filter-tree(scope).
func FilterUsersUnscoped ¶
FilterUsersUnscoped is the explicit, greppable opt-out: it renders TRUE.
Types ¶
type CountByStatusParams ¶
type CountByStatusParams struct {
TenantID int64
}
type CountByStatusRow ¶
type DBTX ¶
type DBTX 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
}
DBTX matches sqlc's database/sql flavor: a *sql.DB or *sql.Tx satisfies it, so sqlc- and sqletch-generated code share transactions.
type FilterUsersParams ¶
type FilterUsersParams struct {
Limit int64
}
type FilterUsersRow ¶
type FindUserByEmailParams ¶
type FindUserByEmailParams struct {
Email string
}
type FindUserByEmailRow ¶
type Querier ¶
type Querier interface {
CountByStatus(ctx context.Context, arg CountByStatusParams) ([]CountByStatusRow, error)
FilterUsers(ctx context.Context, scope runtime.Tree, arg FilterUsersParams) ([]FilterUsersRow, error)
FindUserByEmail(ctx context.Context, arg FindUserByEmailParams) (optional.Option[FindUserByEmailRow], error)
SearchUsers(ctx context.Context, arg SearchUsersParams) ([]SearchUsersRow, error)
UsersInStatuses(ctx context.Context, arg UsersInStatusesParams) ([]UsersInStatusesRow, error)
}
Querier lets user code mock the generated queries.
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) Cache ¶
func (q *Queries) Cache() *runtime.ComposedCache
Cache exposes the composed-SQL cache for scrape-time inspection (Stats, TopShapes). Mutating it is the generated code's business, not the caller's.
func (*Queries) CountByStatus ¶
func (q *Queries) CountByStatus(ctx context.Context, arg CountByStatusParams) ([]CountByStatusRow, error)
func (*Queries) FilterUsers ¶
func (q *Queries) FilterUsers(ctx context.Context, scope runtime.Tree, arg FilterUsersParams) ([]FilterUsersRow, error)
scope is required (@filter-tree!; FilterUsersUnscoped() opts out).
func (*Queries) FindUserByEmail ¶
func (q *Queries) FindUserByEmail(ctx context.Context, arg FindUserByEmailParams) (optional.Option[FindUserByEmailRow], error)
func (*Queries) OnQuery ¶
OnQuery installs an observability hook receiving the shape key and the composed SQL of every call.
func (*Queries) SearchUsers ¶
func (q *Queries) SearchUsers(ctx context.Context, arg SearchUsersParams) ([]SearchUsersRow, error)
func (*Queries) SetObserver ¶
SetObserver installs a runtime observer receiving compose, exec, and reject events for every query on this Queries value and any WithTx derivative (design doc 18). Install it before serving traffic; Cache() exposes the same cache for scrape-time Stats and TopShapes.
func (*Queries) UsersInStatuses ¶
func (q *Queries) UsersInStatuses(ctx context.Context, arg UsersInStatusesParams) ([]UsersInStatusesRow, error)
type SearchUsersParams ¶
type SearchUsersRow ¶
type SearchUsersSort ¶
type SearchUsersSort int
const ( SearchUsersSortDefault SearchUsersSort = iota SearchUsersSortEmailAsc )