-
Notifications
You must be signed in to change notification settings - Fork 16
Examples XLSX Connection
Michael Anderson edited this page Dec 12, 2017
·
1 revision
The XLSX driver connects to a local Excel .xlsx file. The XLSX driver does not support transactions.
xlsx:///file_path
const Connection = require('database-js2').Connection;
var connection = new Connection('xlsx:///data.xlsx');
var Connection = require('database-js2');
(async () => {
let connection, statement, rows;
connection = new Connection('xlsx:///test.xlsx');
try {
statement = await connection.prepareStatement("SELECT * FROM Sheet1 WHERE State = ?");
rows = await statement.query('South Dakota');
console.log(rows);
} catch (error) {
console.log(error);
} finally {
await connection.close();
}
})();