From 6f4a41fbd7e19b6ae7428b39406840e37fa41c5a Mon Sep 17 00:00:00 2001 From: sudoer777 <78781902+sudoer777@users.noreply.github.com> Date: Sat, 20 Nov 2021 16:51:49 -0700 Subject: [PATCH] Edit database.js --- database/database.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/database/database.js b/database/database.js index 766168d..f166980 100644 --- a/database/database.js +++ b/database/database.js @@ -18,7 +18,7 @@ async function executeQuery(query, values = []) { return result.rows; } -async function InitializeDatabase() { +async function Initialize() { console.log("Initializing database...") const sql = fs.readFileSync('database/init_database.sql').toString(); await executeQuery(sql); @@ -35,7 +35,13 @@ async function checkForDatabaseInitialization() { const scoresSchemaExists = result.length !== 0; if(!scoresSchemaExists) { - InitializeDatabase(); + Initialize(); } } -checkForDatabaseInitialization(); \ No newline at end of file +checkForDatabaseInitialization(); + + + + + +exports.executeQuery = executeQuery; \ No newline at end of file