summaryrefslogtreecommitdiff
path: root/db-create.rb
diff options
context:
space:
mode:
authorpks <pks@pks.rocks>2020-09-27 20:55:18 +0200
committerpks <pks@pks.rocks>2020-09-27 20:55:18 +0200
commit1123b0db81b6057e113f16a1ddea15c36b7b3d79 (patch)
treeb749c4cc5c3a63441ad408d56dd84cc7645a6201 /db-create.rb
init
Diffstat (limited to 'db-create.rb')
-rwxr-xr-xdb-create.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/db-create.rb b/db-create.rb
new file mode 100755
index 0000000..a9bf771
--- /dev/null
+++ b/db-create.rb
@@ -0,0 +1,24 @@
+#!/usr/bin/env ruby
+
+require 'sqlite3'
+
+def main
+ db = SQLite3::Database.new ARGV[0]
+
+ db.execute <<-SQL
+ create table power(
+ id INTEGER PRIMARY KEY,
+ timestamp DATETIME,
+ device_name TEXT,
+ device_location_primary TEXT,
+ device_location_secondary TEXT,
+ total FLOAT,
+ total_start_time DATETIME
+ );
+ SQL
+
+ db.close
+end
+
+
+main