wam/main.js

24 lines
629 B
JavaScript
Raw Normal View History

2021-10-23 10:53:22 +02:00
import wam from "./db.js";
const db_struct = {
accounts: {
ID: {type:"int", A_I:true},
accountId: {type:"text" },
name: {type:"text" },
accountkey: {type:"text" },
},
};
2022-09-05 22:29:07 +02:00
const host="localhost", port=3306, user="user", password="12345678", database="testDB";
2021-10-23 10:53:22 +02:00
const db = new wam({host, port, user, password, database})
db.connect()
.then(()=>db.check(db_struct))
.then(()=>console.log("db is now ready!"))
.catch(err=>{
console.log("Can not connect properly to the Database: ",err);
process.exit();
});