diff --git a/database/db_scripts/fill_database.sql b/database/db_scripts/fill_database.sql index 523ec8b..5fcda43 100644 --- a/database/db_scripts/fill_database.sql +++ b/database/db_scripts/fill_database.sql @@ -3,8 +3,6 @@ BEGIN DECLARE i INT DEFAULT 1; DECLARE emailString CHAR(16) DEFAULT 'test'; - DELETE FROM webshop.user; - WHILE i < 100 DO SET emailString = CONCAT(emailString, CAST(i AS CHAR(16)), '@test.de'); diff --git a/package-lock.json b/package-lock.json index 1d8698a..8ccc96d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,11 +9,9 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "app-root-path": "^3.1.0", "dotenv": "^16.4.7", "express": "^4.21.2", - "app-root-path": "^3.1.0", - "dotenv": "^16.4.5", - "express": "^4.21.1", "express-session": "^1.18.1", "mysql": "^2.18.1", "mysql2": "^3.12.0", diff --git a/scripts/query/get_products.js b/scripts/query/get_products.js new file mode 100644 index 0000000..9f51378 --- /dev/null +++ b/scripts/query/get_products.js @@ -0,0 +1,17 @@ +const mysql = require('mysql'); + +const connection = mysql.createConnection({ + host: "localhost", + user: "root", + password: "", + database: "webshop" +}) + +connection.connect(function (err) { + if (err) throw err + console.log("Connected to database") + connection.query("SELECT * FROM webshop.product LIMIT 10", function (err, result) { + if (err) throw err + console.log(result) + }) +}) \ No newline at end of file