- [API] Finished the request to get all spells (associated tables for instance)
This commit is contained in:
@@ -13,4 +13,10 @@ const db = mysql.createConnection({
|
||||
database: credentials.database,
|
||||
})
|
||||
|
||||
db.on('error', err => {
|
||||
if (err.errno == 'ECONNRESET') {
|
||||
console.log("The connection was reset during your request. Please try again later.");
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = { db }
|
||||
7
database/querytests.sql
Normal file
7
database/querytests.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
USE spellsaurus;
|
||||
|
||||
/* Fetches a specific spell's school(s) */
|
||||
SELECT school.name
|
||||
FROM spells_schools AS sc
|
||||
INNER JOIN school AS school ON sc.id_school = school.id
|
||||
WHERE sc.id_spell = 1;
|
||||
@@ -1,14 +1,3 @@
|
||||
DROP USER IF EXISTS 'archivist'@'%';
|
||||
|
||||
CREATE USER 'archivist'@'%'
|
||||
IDENTIFIED BY 'root';
|
||||
|
||||
GRANT ALL
|
||||
ON spellsaurus.*
|
||||
TO 'archivist'@'%';
|
||||
|
||||
FLUSH PRIVILEGES;
|
||||
|
||||
DROP DATABASE IF EXISTS spellsaurus;
|
||||
CREATE DATABASE spellsaurus;
|
||||
USE spellsaurus;
|
||||
|
||||
Reference in New Issue
Block a user