summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-03-22 17:18:22 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-03-22 17:18:22 +0100
commit2cf0c9e8f96c38d86a22cd21955bc7e8444bc316 (patch)
treed36e359d9d379d43fbaa8712485164dd8b260536
parent7ac8176f7889f6e38d10a31f94e102ed50832407 (diff)
downloadRustAndDust-2cf0c9e8f96c38d86a22cd21955bc7e8444bc316.zip
RustAndDust-2cf0c9e8f96c38d86a22cd21955bc7e8444bc316.tar.gz
add tools/sqlite_dumb
-rwxr-xr-xtools/sqlite_dumb7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/sqlite_dumb b/tools/sqlite_dumb
new file mode 100755
index 0000000..9e5c5a0
--- /dev/null
+++ b/tools/sqlite_dumb
@@ -0,0 +1,7 @@
+#! /bin/bash
+
+sqlite3 android/assets/data/rustanddust.sqlite 'select state from games order by ts desc limit 1' > state.json
+sqlite3 android/assets/data/rustanddust.sqlite 'select orders from games order by ts desc limit 1' > orders.json
+# echo "[" > turns.json
+# sqlite3 android/assets/data/rustanddust.sqlite 'select payload from turns where game=(select _id from games order by ts desc limit 1) order by _id' | while read rec; do echo "$rec,"; done >> turns.json
+# sed -i '$s/,$/]/' turns.json