diff options
Diffstat (limited to 'src/db.go')
-rw-r--r-- | src/db.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/db.go b/src/db.go index da58951..c26e054 100644 --- a/src/db.go +++ b/src/db.go @@ -20,7 +20,7 @@ func setupDatabase() *sql.DB { } // getNames gets the name of all the challenges -func getName(db *sql.DB) string { +func dbGetName(db *sql.DB) string { // get the current name of the challenges query := fmt.Sprintf("SELECT name FROM challenges WHERE points=200") @@ -34,7 +34,7 @@ func getName(db *sql.DB) string { } // getAllChallenges gets all the challenges from the server -func getAllChallenges(db *sql.DB) []Challenge { +func dbGetAllChallenges(db *sql.DB) []Challenge { // build the query query := fmt.Sprintf("SELECT * FROM challenges") @@ -97,7 +97,7 @@ func dbNewChallenge(challenge Challenge) (string, error) { } // editChallengeUUID edited the challenge with the given uuid using the values in the updatedChallenge -func editChallengeUUID(uuid string, updatedChallenge Challenge) error { +func dbEditChallengeUUID(uuid string, updatedChallenge Challenge) error { query := fmt.Sprintf("UPDATE challenges SET name = '%s', description = '%s', flag = '%s', container = '%s', category = '%s', points = %d, static = %t WHERE uuid::text = '%s'", updatedChallenge.Name, updatedChallenge.Description, updatedChallenge.Flag, updatedChallenge.Container, updatedChallenge.Category, updatedChallenge.Points, updatedChallenge.Static, updatedChallenge.UUID) _, _ = db.Exec(query) |