asobi_ops_matches (asobi v0.72.5)

View Source

Match-record list for the ops read plane: filter, search, sort, paginate.

asobi_match_controller:index/1 reads the same table but returns a bare list with no total and a fixed order. This returns the standard envelope, so a console can page through match history and know how much of it there is.

Summary

Functions

Positive allowlist of the fields a match row may carry off this endpoint.

Wire-name to column mapping this endpoint accepts in ?sort=.

Functions

project(Record)

-spec project(map()) -> map().

Positive allowlist of the fields a match row may carry off this endpoint.

Identical to asobi_match_controller's public projection, and for the same reason: players holds the full roster of a match the caller may not have been in, so it never leaves. result is game-authored and stays.

query(Params)

-spec query(asobi_ops_params:params()) ->
               {ok,
                #kura_query{from :: atom() | module() | undefined,
                            select :: [atom() | term()] | {exprs, [term()]},
                            wheres :: [term()],
                            joins :: [term()],
                            order_bys :: [term()],
                            group_bys :: [atom()],
                            havings :: [term()],
                            limit :: non_neg_integer() | undefined,
                            offset :: non_neg_integer() | undefined,
                            distinct :: boolean() | [atom()],
                            lock :: binary() | undefined,
                            prefix :: binary() | undefined,
                            preloads :: [atom() | {atom(), list()}],
                            ctes :: [{binary(), #kura_query{}}],
                            combinations :: [{union | union_all | intersect | except, #kura_query{}}],
                            include_deleted :: boolean()}} |
               {error,
                {unknown_sort, binary()} | {unknown_order, binary()} | {invalid_filter, binary()}}.

sortable()

-spec sortable() -> asobi_ops_params:sort_allowlist().

Wire-name to column mapping this endpoint accepts in ?sort=.