Introduce structs/interfacess for new storage units

This commit simply splits the interfaces but introduces no new structs

     - Introduce the QueryPackStore, mrvacommander/pkg/qpstore
     - Introduce the CodeQL database store, pkg/qldbstore/interfaces.go
This commit is contained in:
Michael Hohn
2024-06-11 14:16:41 -07:00
committed by =Michael Hohn
parent fc29fc5653
commit 2d88b351ff
8 changed files with 176 additions and 31 deletions

View File

@@ -41,33 +41,6 @@ func NewQLDBStore() (*StorageContainer, error) {
return nil, nil
}
func NewQueryPackStore(startingID int) (*StorageContainer, error) {
// TODO set up querypack_db
// TODO drop the startingID
db, err := ConnectDB(DBSpec{
Host: "postgres",
Port: 5432,
User: "exampleuser",
Password: "examplepass",
DBname: "querypack_db",
})
if err != nil {
return nil, err
}
s := StorageContainer{RequestID: startingID, DB: db}
if err := s.SetupDB(); err != nil {
return nil, err
}
if err = s.loadState(); err != nil {
return nil, err
}
return &s, nil
}
func NewStorageContainer(startingID int) (*StorageContainer, error) {
db, err := ConnectDB(DBSpec{