-
Notifications
You must be signed in to change notification settings - Fork 0
MySQL
Adrian Preuß edited this page Jun 13, 2025
·
1 revision
Database.setType(Database.MySQL, {
/* Connection */
Hostname: 'localhost',
Port: 3306,
Username: 'root',
password: '',
Database: 'test',
/* Optional */
Charset: 'utf8',
Connections: 10,
Timezone: 'Europe/Berlin'
});let result = await Database.query('SELECT * FROM id=1');
console.log(result);
/* Or with Promises and Parameter-Binding */
Database.query('SELECT * FROM id=:id', {
id: 1
}).then((results) => {
console.log(results);
}).catch((error) => {
console.error(error);
});