about summary refs log tree commit diff
path: root/src/db.go
diff options
context:
space:
mode:
authorEmile <hanemile@protonmail.com>2019-10-20 00:31:13 +0200
committerEmile <hanemile@protonmail.com>2019-10-20 00:31:13 +0200
commit4f4317f59150588482779ab3e6f78cb4269bcd67 (patch)
tree07b8c7e2d4b67ce672f21dfe6c2dc5697dfd58c8 /src/db.go
parent027a5ee0fc896f5bbbe10bb2505a5942232ab995 (diff)
consistet naming for the db functions
Diffstat (limited to 'src/db.go')
-rw-r--r--src/db.go6
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)