From dfa0872dd7940b6d2759d8901274f459edf1b46e Mon Sep 17 00:00:00 2001
From: schneefux <schneefux+commit@schneefux.xyz>
Date: Tue, 28 Mar 2017 18:30:06 +0200
Subject: rewrite in NodeJS

---
 queries/roster.sql | 20 --------------------
 1 file changed, 20 deletions(-)
 delete mode 100644 queries/roster.sql

(limited to 'queries/roster.sql')

diff --git a/queries/roster.sql b/queries/roster.sql
deleted file mode 100644
index f6500fb..0000000
--- a/queries/roster.sql
+++ /dev/null
@@ -1,20 +0,0 @@
-WITH rosters AS (SELECT
-  id AS matchid,
-  JSONB_ARRAY_ELEMENTS(match.data->'relations') AS roster
-FROM match WHERE id=$1)
-SELECT
-roster->'data'->>'id' AS "api_id",
-matchid AS "match_api_id",
-(roster->'data'->'attributes'->'stats'->>'acesEarned')::int AS "aces_earned",
-(roster->'data'->'attributes'->'stats'->>'gold')::int AS "gold",
-(roster->'data'->'attributes'->'stats'->>'heroKills')::int AS "hero_kills",
-(roster->'data'->'attributes'->'stats'->>'krakenCaptures')::int AS "kraken_captures",
-roster->'data'->'attributes'->'stats'->>'side' AS "side",
-roster->'data'->'attributes'->'stats'->>'side' AS "team_color",
-(roster->'data'->'attributes'->'stats'->>'turretKills')::int AS "turret_kills",
-(roster->'data'->'attributes'->'stats'->>'turretsRemaining')::int AS "turrets_remaining",
-
-roster->'relations'->0->'data'->>'id' AS "participant_1",
-roster->'relations'->1->'data'->>'id' AS "participant_2",
-roster->'relations'->2->'data'->>'id' AS "participant_3"
-FROM rosters
-- 
cgit v1.3.1

