initial run todos

This commit is contained in:
Thomas Rudin 2019-01-09 16:31:24 +01:00
parent 730d932835
commit 0223db6587

View File

@ -14,8 +14,7 @@ func init(){
}
const migrateScript = `
alter table blocks add mtime integer default NULL;
update blocks set mtime = strftime('%s', 'now');
alter table blocks add mtime integer default 0;
create index blocks_mtime on blocks(mtime);
CREATE TRIGGER update_blocks_mtime_insert after insert on blocks for each row
@ -29,6 +28,9 @@ update blocks set mtime = strftime('%s', 'now') where pos = old.pos;
end;
`
//TODO: initial run: https://stackoverflow.com/questions/14468586/efficient-paging-in-sqlite-with-millions-of-records
//TODO: postgres test
type Sqlite3Accessor struct {
db *sql.DB
filename string