From 3d48d953038915f254299c172556fcf9b770332a Mon Sep 17 00:00:00 2001 From: Joe Tretter Date: Sun, 8 Mar 2020 20:52:48 -0500 Subject: [PATCH] add script to create consolidated db --- server/quoteDBs/createTable.sql | 4 ++++ server/quoteDBs/fillBigDB.sh | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 server/quoteDBs/createTable.sql create mode 100644 server/quoteDBs/fillBigDB.sh diff --git a/server/quoteDBs/createTable.sql b/server/quoteDBs/createTable.sql new file mode 100644 index 0000000..a81aee0 --- /dev/null +++ b/server/quoteDBs/createTable.sql @@ -0,0 +1,4 @@ +CREATE TABLE IF NOT EXISTS "OptionQuotes"("Id" INTEGER, +"TimeStamp"DateTime DEFAULT CURRENT_TIMESTAMP, +"Symbol" Text, +"Data" Text); diff --git a/server/quoteDBs/fillBigDB.sh b/server/quoteDBs/fillBigDB.sh new file mode 100644 index 0000000..5b5ceab --- /dev/null +++ b/server/quoteDBs/fillBigDB.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +rm consolidated.sqlite3 + +sqlite3 consolidated.sqlite3 < createTable.sql + +ls quoteStore_202*.sqlite3 | while read db; do + sqlite3 $db '.dump OptionQuotes' | sqlite3 consolidated.sqlite3 +done