diff --git a/appview/db/db.go b/appview/db/db.go index 1bb3993..5d9ae04 100644 --- a/appview/db/db.go +++ b/appview/db/db.go @@ -16,6 +16,15 @@ func Make(dbPath string) (*DB, error) { return nil, err } _, err = db.Exec(` + pragma journal_mode = WAL; + pragma synchronous = normal; + pragma foreign_keys = on; + pragma temp_store = memory; + pragma mmap_size = 30000000000; + pragma page_size = 32768; + pragma auto_vacuum = incremental; + pragma busy_timeout = 5000; + create table if not exists registrations ( id integer primary key autoincrement, domain text not null unique, diff --git a/knotserver/db/init.go b/knotserver/db/init.go index c27f948..0f74fd2 100644 --- a/knotserver/db/init.go +++ b/knotserver/db/init.go @@ -17,6 +17,15 @@ func Setup(dbPath string) (*DB, error) { } _, err = db.Exec(` + pragma journal_mode = WAL; + pragma synchronous = normal; + pragma foreign_keys = on; + pragma temp_store = memory; + pragma mmap_size = 30000000000; + pragma page_size = 32768; + pragma auto_vacuum = incremental; + pragma busy_timeout = 5000; + create table if not exists known_dids ( did text primary key ); @@ -30,15 +39,6 @@ func Setup(dbPath string) (*DB, error) { foreign key (did) references known_dids(did) on delete cascade ); - create table if not exists repos ( - id integer primary key autoincrement, - did text not null, - name text not null, - description text not null, - created text not null default (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')), - unique(did, name) - ); - create table if not exists _jetstream ( id integer primary key autoincrement, last_time_us integer not null