Add retention policy, remove WAL subdir

This commit is contained in:
Ben Johnson
2021-01-11 16:49:51 -07:00
parent 1fa1313b0b
commit faa5765745
4 changed files with 240 additions and 152 deletions

4
db.go
View File

@@ -31,6 +31,7 @@ const (
DefaultCheckpointInterval = 1 * time.Minute
DefaultMinCheckpointPageN = 1000
DefaultMaxCheckpointPageN = 10000
DefaultRetentionInterval = 24 * time.Hour
)
// DB represents a managed instance of a SQLite database in the file system.
@@ -41,7 +42,8 @@ type DB struct {
rtx *sql.Tx // long running read transaction
pageSize int // page size, in bytes
notify chan struct{} // closes on WAL change
uid, gid int // db user/group obtained on init
uid, gid int // db user/group obtained on init
ctx context.Context
cancel func()