wip: storage using postgres / gorm using partial json

Several approaches of normalizing json were tried and ultimately found
impractical at this point.

Using a hybrid of tables and json is the current approach; this may be
further normalized later.
This commit is contained in:
Michael Hohn
2024-06-06 13:19:00 -07:00
committed by =Michael Hohn
parent 593644ca2e
commit 25cab583c1
12 changed files with 88 additions and 246 deletions

View File

@@ -64,13 +64,13 @@ func (c *CommanderSingle) StatusResponse(w http.ResponseWriter, js common.JobSpe
all_scanned := []common.ScannedRepo{}
jobs := storage.GetJobList(js.JobID)
for _, job := range jobs {
astat := storage.GetStatus(js.JobID, job.ORL).ToExternalString()
astat := storage.GetStatus(js.JobID, job.ORepo).ToExternalString()
all_scanned = append(all_scanned,
common.ScannedRepo{
Repository: common.Repository{
ID: 0,
Name: job.ORL.Repo,
FullName: fmt.Sprintf("%s/%s", job.ORL.Owner, job.ORL.Repo),
Name: job.ORepo.Repo,
FullName: fmt.Sprintf("%s/%s", job.ORepo.Owner, job.ORepo.Repo),
Private: false,
StargazersCount: 0,
UpdatedAt: ji.UpdatedAt,
@@ -143,7 +143,7 @@ func (c *CommanderSingle) MirvaStatus(w http.ResponseWriter, r *http.Request) {
js := common.JobSpec{
JobID: job.QueryPackId,
OwnerRepo: job.ORL,
OwnerRepo: job.ORepo,
}
ji := storage.GetJobInfo(js)
@@ -367,7 +367,7 @@ func submit_response(sn SessionInfo) ([]byte, error) {
for _, job := range joblist {
storage.SetJobInfo(common.JobSpec{
JobID: sn.ID,
OwnerRepo: job.ORL,
OwnerRepo: job.ORepo,
}, common.JobInfo{
QueryLanguage: sn.Language,
CreatedAt: m_sr.CreatedAt,