summaryrefslogtreecommitdiff
path: root/queries/player.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/player.sql
parentf716c0f770c3a482350089348fa919a626452bf4 (diff)
downloadprocessor-0455416095e0347d644716d4438fb2b8b14c8db2.tar.gz
processor-0455416095e0347d644716d4438fb2b8b14c8db2.zip
load processor queries from sql files
Diffstat (limited to 'queries/player.sql')
-rw-r--r--queries/player.sql21
1 files changed, 21 insertions, 0 deletions
diff --git a/queries/player.sql b/queries/player.sql
new file mode 100644
index 0000000..cf71d20
--- /dev/null
+++ b/queries/player.sql
@@ -0,0 +1,21 @@
+SELECT
+
+id AS "apiId",
+attributes->>'name' AS "name",
+(attributes->'stats'->>'level')::int AS "level",
+(attributes->'stats'->>'xp')::int AS "xp",
+(attributes->'stats'->>'played')::int AS "played",
+0 AS "totalGamePlaytime",
+(attributes->'stats'->>'played_ranked')::int AS "playedRanked",
+(attributes->'stats'->>'wins')::int AS "wins",
+(attributes->'stats'->>'winStreak')::int AS "streak",
+'' AS "herosUnlocked",
+'' "skinsUnlocked",
+attributes->'stats'->>'lifetimeGold' AS "lifeTimeGold",
+0 AS "lifeTimeKills",
+0 AS "lifeTimeDeaths",
+0 AS "lifeTimeAssists",
+0 AS "lifeTimeKD",
+0 AS "lifeTimeKDA"
+
+FROM apidata WHERE type='player'