wrappers/tests/testMaria.js

25 lines
612 B
JavaScript
Raw Normal View History

2023-05-02 23:59:06 +02:00
import { readFileSync } from 'fs';
import { MariaDB } from '../build/esm/index.js';
const credentials = JSON.parse(readFileSync('./credentials.json', { encoding: 'utf-8' }));
const maria = new MariaDB({
createLogger: () => {
return {
debug: console.log,
info: console.log,
status: console.log,
warn: console.log,
error: console.error
};
}
}, {
load: true,
credentials
});
await maria.init();
await maria.query('INSERT INTO `test` (`dingle`, `bingle`) VALUES ?', [[ 1, 2 ], [ 3, 4 ], [ 5, 6 ]]);
await maria.close();