update repos
This commit is contained in:
parent
54289237be
commit
84589d6d7a
@ -8,6 +8,11 @@ defmodule LolAnalytics.Match.MatchRepo do
|
||||
LoLAnalytics.Repo.all(query)
|
||||
end
|
||||
|
||||
def number_of_matches do
|
||||
query = from m in MatchSchema, select: count(m.match_id)
|
||||
LoLAnalytics.Repo.one(query)
|
||||
end
|
||||
|
||||
@spec get_match(String.t()) :: %LolAnalytics.Match.MatchSchema{}
|
||||
def get_match(match_id) do
|
||||
query = from m in MatchSchema, where: m.match_id == ^match_id
|
||||
|
@ -4,10 +4,15 @@ defmodule LolAnalytics.Player.PlayerRepo do
|
||||
import Ecto.Query
|
||||
|
||||
def list_players do
|
||||
query = from(p in PlayerSchema)
|
||||
query = from p in PlayerSchema, order_by: [desc: p.id]
|
||||
LoLAnalytics.Repo.all(query)
|
||||
end
|
||||
|
||||
def number_of_players do
|
||||
query = from p in PlayerSchema, select: count(p.id)
|
||||
LoLAnalytics.Repo.one(query)
|
||||
end
|
||||
|
||||
def get_player(puuid) do
|
||||
query = from p in PlayerSchema, where: p.puuid == ^puuid
|
||||
LoLAnalytics.Repo.one(query)
|
||||
|
Loading…
x
Reference in New Issue
Block a user