Mysync
Mysync is a quick and simple way to query mysql synchronous
Installation
npm install mysync
Usage
const mysql = require('mysync')
const connection = new mysql({
host: 'your-mysql-host',
database: 'your-mysql-database',
user: 'your-mysql-user',
password: 'your-mysql-password'
})
const result1 = connection.query('SELECT * FROM users')
const result2 = connection.query('SELECT * FROM users WHERE id = ?', ['abc123'])
Response
The query function always repond with an object with containing properties. Type & Data... Type contains eighter "response" or "error". And data contains the value of eighter the response or error