- 
                Notifications
    You must be signed in to change notification settings 
- Fork 17
Examples CSV Connection
        Thiago Delgado Pinto edited this page Dec 15, 2017 
        ·
        1 revision
      
    The CSV file driver connects to a local CSV file. It does not support transactions.
csv:///file_path
var Connection = require('database-js2').Connection;
(async () => {
    let connection, statement, rows;
    connection = new Database('csv:///test.csv?headers=true&overwriteOnExecute=true');
    
    try {
        statement = await connection.prepareStatement("SELECT * WHERE user_name = ?");
        rows = await statement.query('not_so_secret_user');
        console.log(rows);
    } catch (error) {
        console.log(error);
    } finally {
        await connection.close();
    }
})();