summaryrefslogtreecommitdiff
path: root/queries/match.sql
diff options
context:
space:
mode:
authorKapil Viren Ahuja <kvahuja@users.noreply.github.com>2017-02-16 10:45:08 +0530
committerGitHub <noreply@github.com>2017-02-16 10:45:08 +0530
commit5a932151539247fef874c9bcb8e49b8483c529cd (patch)
tree1507cbc9964f37cfebe9c525929209c064ed33ff /queries/match.sql
parent4ef6c2e89409efca4dc7bae21d9648605a0f2828 (diff)
parent0455416095e0347d644716d4438fb2b8b14c8db2 (diff)
downloadshrinker-5a932151539247fef874c9bcb8e49b8483c529cd.tar.gz
shrinker-5a932151539247fef874c9bcb8e49b8483c529cd.zip
Merge pull request #9 from vainglorygame/queries_from_dir
Queries from dir
Diffstat (limited to 'queries/match.sql')
-rw-r--r--queries/match.sql18
1 files changed, 18 insertions, 0 deletions
diff --git a/queries/match.sql b/queries/match.sql
new file mode 100644
index 0000000..970412b
--- /dev/null
+++ b/queries/match.sql
@@ -0,0 +1,18 @@
+SELECT
+
+id AS "match_id",
+(attributes->>'duration')::int AS "duration",
+attributes->>'gameMode' AS "gameMode",
+COALESCE(NULLIF(attributes->>'patchVersion', ''), '0')::int AS "patchVersion",
+attributes->>'shardId' AS "shard",
+attributes->'stats'->>'endGameReason' AS "result",
+attributes->'stats'->>'queue' AS "queue",
+
+false AS "anyAFK",
+'' AS "winningTeam",
+0 AS "krakenCaptures",
+0 AS "laneMinionsSlayed",
+0 AS "jungleMinionsSlayed",
+0 AS "heroDeaths"
+
+FROM apidata WHERE type='match'