From /var/www/html/AIO
sqlite
sqlite> .read build-ramdisk.sql
SQL error: near "not": syntax error
drop view if exists period97hrs;
SQL error: near "exists": syntax error
CREATE VIEW if not exists period97hrs as select * from ir where dt >= (select datetime(max(dt), '-97 hour') from ir) order by dt;
SQL error: near "not": syntax error
drop view if exists period193hrs;
SQL error: near "exists": syntax error
CREATE VIEW if not exists period193hrs as select * from ir where dt >= (select datetime(max(dt), '-193 hour') from ir) order by dt;
SQL error: near "not": syntax error
drop view if exists interval10min;
SQL error: near "exists": syntax error
CREATE VIEW if not exists interval10min as select * from ir where substr(datetime(dt),16,1) = '0' order by dt;
SQL error: near "not": syntax error
drop view if exists interval12min;
SQL error: near "exists": syntax error
CREATE VIEW if not exists interval12min as select * from ir where substr(datetime(dt),16,1) = '0' order by dt;
SQL error: near "not": syntax error
attach 'aiox.db' as ssd;
SQL error: file is encrypted or is not a database
seq name file
--- --------------- ----------------------------------------------------------
0 main
1 temp
ACInModels ChargeConfigs SystemStatuses
BatteryTypes OutputConfigs hrs
begin transaction;
-- keep last 3 days in ramdisk
select date(max(dt), '-3 days') from ssd.irx ;
SQL error: no such table: ssd.irx
insert or ignore into irx select * from ssd.irx where dt > (select date(max(dt), '-3 days') from ssd.irx) ;
SQL error: no such table: irx
insert or ignore into ir select * from ssd.ir where dt > (select date(max(dt), '-3 days') from ssd.ir) ;
SQL error: no such table: ir
insert or ignore into hrx select * from ssd.hrx where dt > (select date(max(dt), '-3 days') from ssd.hrx) ;
SQL error: no such table: hrx
insert or ignore into hr select * from ssd.hr where dt > (select date(max(dt), '-3 days') from ssd.hr) ;
SQL error: no such table: hr
end transaction;
sqlite> .read build-ramdisk.sql ; This is what I 'ran'