create new index that records the links between pubkeys, events, kinds, and inbound/outbound/author

This commit is contained in:
2025-11-20 05:13:56 +00:00
parent d4e2f48b7e
commit b7417ab5eb
7 changed files with 932 additions and 2 deletions

View File

@@ -26,7 +26,8 @@ type D struct {
Logger *logger
*badger.DB
seq *badger.Sequence
ready chan struct{} // Closed when database is ready to serve requests
pubkeySeq *badger.Sequence // Sequence for pubkey serials
ready chan struct{} // Closed when database is ready to serve requests
queryCache *querycache.EventCache
}
@@ -136,6 +137,9 @@ func New(
if d.seq, err = d.DB.GetSequence([]byte("EVENTS"), 1000); chk.E(err) {
return
}
if d.pubkeySeq, err = d.DB.GetSequence([]byte("PUBKEYS"), 1000); chk.E(err) {
return
}
// run code that updates indexes when new indexes have been added and bumps
// the version so they aren't run again.
d.RunMigrations()