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:
committed by
=Michael Hohn
parent
fc29fc5653
commit
2d88b351ff
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user