wrappers/tests/testMaria.js

26 lines
617 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({
2023-07-03 15:33:39 +02:00
createLogger: () =>
{
2023-05-02 23:59:06 +02:00
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();