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 AllAuditActionsParams
- type AllAuditActionsRow
- type CountAuditLogsParams
- type CountAuditLogsRow
- type DBTX
- type FilterUsersParams
- type FilterUsersRow
- type FindUserByEmailParams
- type FindUserByEmailRow
- type GetUserProfileParams
- type GetUserProfileRow
- type ListAuditLogsParams
- type ListAuditLogsRow
- type ListUsersSortedParams
- type ListUsersSortedRow
- type ListUsersSortedSortKey
- type Querier
- type Queries
- func (q *Queries) AllAuditActions(ctx context.Context, arg AllAuditActionsParams) ([]AllAuditActionsRow, error)
- func (q *Queries) Cache() *runtime.ComposedCache
- func (q *Queries) CountAuditLogs(ctx context.Context, tenantID TenantID, arg CountAuditLogsParams) (CountAuditLogsRow, 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) GetUserProfile(ctx context.Context, arg GetUserProfileParams) (GetUserProfileRow, error)
- func (q *Queries) ListAuditLogs(ctx context.Context, arg ListAuditLogsParams) ([]ListAuditLogsRow, error)
- func (q *Queries) ListUsersSorted(ctx context.Context, arg ListUsersSortedParams) ([]ListUsersSortedRow, 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) UpdateUserProfile(ctx context.Context, arg UpdateUserProfileParams) (UpdateUserProfileRow, error)
- func (q *Queries) UserAuditActions(ctx context.Context, tenantID TenantID, arg UserAuditActionsParams) ([]UserAuditActionsRow, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type SearchUsersParams
- type SearchUsersRow
- type SearchUsersSort
- type TenantID
- type UpdateUserProfileParams
- type UpdateUserProfileRow
- type UserAuditActionsParams
- type UserAuditActionsRow
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{ "AllAuditActions": {Enumerable: 1, Exact: true, Unbounded: false}, "CountAuditLogs": {Enumerable: 1, Exact: true, Unbounded: false}, "FilterUsers": {Enumerable: 1, Exact: true, Unbounded: true}, "FindUserByEmail": {Enumerable: 1, Exact: true, Unbounded: false}, "GetUserProfile": {Enumerable: 2, Exact: true, Unbounded: false}, "ListAuditLogs": {Enumerable: 2, Exact: true, Unbounded: false}, "ListUsersSorted": {Enumerable: 26, Exact: true, Unbounded: false}, "SearchUsers": {Enumerable: 64, Exact: true, Unbounded: false}, "UpdateUserProfile": {Enumerable: 4, Exact: true, Unbounded: false}, "UserAuditActions": {Enumerable: 1, Exact: true, Unbounded: false}, }
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 AllAuditActionsParams ¶
type AllAuditActionsParams struct {
}
type AllAuditActionsRow ¶
type CountAuditLogsParams ¶
type CountAuditLogsParams struct {
}
type CountAuditLogsRow ¶
type CountAuditLogsRow struct {
Total int64
}
type DBTX ¶
type DBTX interface {
Exec(ctx context.Context, sql string, args ...any) (pgconn.CommandTag, error)
Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
}
DBTX matches sqlc's pgx flavor: a pgx.Conn, pgxpool.Pool, or pgx.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 GetUserProfileParams ¶
type GetUserProfileRow ¶
type ListAuditLogsParams ¶
type ListAuditLogsRow ¶
type ListUsersSortedParams ¶
type ListUsersSortedParams struct {
Limit int64
IncludeBanned bool // @when control parameter
Sort []ListUsersSortedSortKey // key sequence; empty = @default
}
type ListUsersSortedRow ¶
type ListUsersSortedSortKey ¶
type ListUsersSortedSortKey int
const ( ListUsersSortedSortCreatedAtAsc ListUsersSortedSortKey = 0 ListUsersSortedSortCreatedAtDesc ListUsersSortedSortKey = 1 ListUsersSortedSortEmailAsc ListUsersSortedSortKey = 2 ListUsersSortedSortEmailDesc ListUsersSortedSortKey = 3 )
type Querier ¶
type Querier interface {
AllAuditActions(ctx context.Context, arg AllAuditActionsParams) ([]AllAuditActionsRow, error)
CountAuditLogs(ctx context.Context, tenantID TenantID, arg CountAuditLogsParams) (CountAuditLogsRow, error)
FilterUsers(ctx context.Context, scope runtime.Tree, arg FilterUsersParams) ([]FilterUsersRow, error)
FindUserByEmail(ctx context.Context, arg FindUserByEmailParams) (optional.Option[FindUserByEmailRow], error)
GetUserProfile(ctx context.Context, arg GetUserProfileParams) (GetUserProfileRow, error)
ListAuditLogs(ctx context.Context, arg ListAuditLogsParams) ([]ListAuditLogsRow, error)
ListUsersSorted(ctx context.Context, arg ListUsersSortedParams) ([]ListUsersSortedRow, error)
SearchUsers(ctx context.Context, arg SearchUsersParams) ([]SearchUsersRow, error)
UpdateUserProfile(ctx context.Context, arg UpdateUserProfileParams) (UpdateUserProfileRow, error)
UserAuditActions(ctx context.Context, tenantID TenantID, arg UserAuditActionsParams) ([]UserAuditActionsRow, error)
}
Querier lets user code mock the generated queries.
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AllAuditActions ¶
func (q *Queries) AllAuditActions(ctx context.Context, arg AllAuditActionsParams) ([]AllAuditActionsRow, error)
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) CountAuditLogs ¶
func (q *Queries) CountAuditLogs(ctx context.Context, tenantID TenantID, arg CountAuditLogsParams) (CountAuditLogsRow, error)
tenantID is required (policy tenant_scope).
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) GetUserProfile ¶
func (q *Queries) GetUserProfile(ctx context.Context, arg GetUserProfileParams) (GetUserProfileRow, error)
func (*Queries) ListAuditLogs ¶
func (q *Queries) ListAuditLogs(ctx context.Context, arg ListAuditLogsParams) ([]ListAuditLogsRow, error)
func (*Queries) ListUsersSorted ¶
func (q *Queries) ListUsersSorted(ctx context.Context, arg ListUsersSortedParams) ([]ListUsersSortedRow, 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) UpdateUserProfile ¶
func (q *Queries) UpdateUserProfile(ctx context.Context, arg UpdateUserProfileParams) (UpdateUserProfileRow, error)
func (*Queries) UserAuditActions ¶
func (q *Queries) UserAuditActions(ctx context.Context, tenantID TenantID, arg UserAuditActionsParams) ([]UserAuditActionsRow, error)
tenantID is required (policy tenant_scope).
type SearchUsersParams ¶
type SearchUsersParams struct {
OrganizationID optional.Option[int64] // None omits the guarded fragment(s)
Status optional.Option[string] // None omits the guarded fragment(s)
EmailPrefix optional.Option[string] // None omits the guarded fragment(s)
CreatedAfter optional.Option[time.Time] // None omits the guarded fragment(s)
Limit int64
Sort SearchUsersSort // zero value selects @default
}
type SearchUsersRow ¶
type SearchUsersSort ¶
type SearchUsersSort int
const ( SearchUsersSortDefault SearchUsersSort = iota SearchUsersSortCreatedAtDesc SearchUsersSortCreatedAtAsc SearchUsersSortEmailAsc )
type TenantID ¶
type TenantID int64
TenantID is the "tenant_id" argument woven by policy tenant_scope. A distinct type keeps same-typed policy arguments from being swapped at a call site; construct it explicitly: TenantID(v).
type UpdateUserProfileParams ¶
type UpdateUserProfileRow ¶
type UserAuditActionsParams ¶
type UserAuditActionsParams struct {
}
Source Files
¶
- all_audit_actions.sql.gen.go
- count_audit_logs.sql.gen.go
- db.gen.go
- filter_users.sql.gen.go
- find_user_by_email.sql.gen.go
- get_user_profile.sql.gen.go
- list_audit_logs.sql.gen.go
- list_users_sorted.sql.gen.go
- policy.gen.go
- querier.gen.go
- search_users.sql.gen.go
- update_user_profile.sql.gen.go
- user_audit_actions.sql.gen.go