Skip to content

Commit

Permalink
Begin working on queries
Browse files Browse the repository at this point in the history
  • Loading branch information
dantecatalfamo committed Sep 30, 2024
1 parent 82b34c4 commit 8be0db6
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions server/datastore/mysql/setup_experience.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,60 @@ package mysql
import "context"

func (ds *Datastore) SetSetupExperienceSoftwareTitles(ctx context.Context, teamID uint, softwareTitleIDs []uint) error {
stmtUnselectInstallers := `
UPDATE software_installers
SET install_during_setup = false
WHERE team_or_global_id = ?`

stmtUnselectVPPAppsTeams := `
UPDATE vpp_apps_teams vat
SET install_during_setup = false
WHERE team_or_global_id = ?`

stmtSelectInstallersIDs := `
SELECT
si.id
FROM
software_titles st
LEFT JOIN
software_installers si
ON st.id = si.title_id
WHERE
global_or_team_id = ?
AND
st.id IN (%s)
`

stmtSelectVPPAppsTeamsID := `
SELECT
vat.id
FROM
software_titles st
LEFT JOIN
vpp_apps va
ON st.id = va.title_id
LEFT JOIN
vpp_apps_teams vat
ON va.adam_id = vat.adam_id
WHERE
global_or_team_id = ?
AND
st.id IN (%s)
`

stmtUpdateInstallers := `
UPDATE software_installers
SET install_during_setup = true
WHERE id IN `

stmtUpdateVPPApps := `
UPDATE vpp_apps_teams
SET install_during_setup = true
WHERE id IN`

return nil
}

// func (ds *Datastore) ListSetupExperienceSoftwareTitles(ctx context.Context, teamID uint) ([]string, error) {
// return nil, nil
// }

0 comments on commit 8be0db6

Please sign in to comment.