summaryrefslogtreecommitdiff
path: root/queries/match_participation.sql
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-02-15 16:02:32 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2017-02-15 16:02:32 +0100
commit0455416095e0347d644716d4438fb2b8b14c8db2 (patch)
tree1507cbc9964f37cfebe9c525929209c064ed33ff /queries/match_participation.sql
parentf716c0f770c3a482350089348fa919a626452bf4 (diff)
downloadprocessor-0455416095e0347d644716d4438fb2b8b14c8db2.tar.gz
processor-0455416095e0347d644716d4438fb2b8b14c8db2.zip
load processor queries from sql files
Diffstat (limited to 'queries/match_participation.sql')
-rw-r--r--queries/match_participation.sql23
1 files changed, 23 insertions, 0 deletions
diff --git a/queries/match_participation.sql b/queries/match_participation.sql
new file mode 100644
index 0000000..0fed84b
--- /dev/null
+++ b/queries/match_participation.sql
@@ -0,0 +1,23 @@
+SELECT
+
+id AS "player_id",
+0 AS "rosterId",
+0 AS "fk_player_id",
+0 AS "fk_match_results_id",
+attributes->>'actor' AS "hero",
+(attributes->'stats'->>'kills')::int AS "kills",
+(attributes->'stats'->>'deaths')::int AS "deaths",
+(attributes->'stats'->>'assists')::int AS "assists",
+0.0 AS "KD",
+0.0 AS "KDA",
+0 AS "killParticipation",
+(attributes->'stats'->>'nonJungleMinionKills')::int AS "laneMinionsSlayed",
+(attributes->'stats'->>'minionKills')::int AS "jungleMinionsSlayed",
+(attributes->'stats'->>'turretCaptures')::int AS "turretsDestroyed",
+(attributes->'stats'->>'krakenCaptures')::int AS "krakenCaptures",
+(attributes->'stats'->>'goldMineCaptures')::int AS "goldMineCaptures",
+(attributes->'stats'->>'crystalMineCaptures')::int AS "crystalMineCaptures",
+(attributes->'stats'->>'wentAfk')::bool::int AS "wentAfk",
+FALSE AS "perfectGame"
+
+FROM apidata WHERE type='participant'